Java Code Examples for org.apache.cassandra.db.marshal.LongType#decompose()
The following examples show how to use
org.apache.cassandra.db.marshal.LongType#decompose() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testCreateFromDecomposedWithoutSufix() { String name = "my_column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromDecomposed(name, decomposedValue, type); Assert.assertEquals(name, column.getName()); Assert.assertEquals(name, column.getFullName()); Assert.assertEquals(type, column.getType()); Assert.assertEquals(composedValue, column.getComposedValue()); Assert.assertEquals(decomposedValue, column.getDecomposedValue()); }
Example 2
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testCreateFromDecomposedWithSufix() { String name = "my"; String sufix = "column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromDecomposed(name, sufix, decomposedValue, type); Assert.assertEquals(name, column.getName()); Assert.assertEquals("my.column", column.getFullName()); Assert.assertEquals(type, column.getType()); Assert.assertEquals(composedValue, column.getComposedValue()); Assert.assertEquals(decomposedValue, column.getDecomposedValue()); }
Example 3
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testCreateFromComposedWithoutSufix() { String name = "my_column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromComposed(name, composedValue, type); Assert.assertEquals(name, column.getName()); Assert.assertEquals(name, column.getFullName()); Assert.assertEquals(type, column.getType()); Assert.assertEquals(composedValue, column.getComposedValue()); Assert.assertEquals(decomposedValue, column.getDecomposedValue()); }
Example 4
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testCreateFromComposedWithSufix() { String name = "my"; String sufix = "column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromComposed(name, sufix, composedValue, type); Assert.assertEquals(name, column.getName()); Assert.assertEquals("my.column", column.getFullName()); Assert.assertEquals(type, column.getType()); Assert.assertEquals(composedValue, column.getComposedValue()); Assert.assertEquals(decomposedValue, column.getDecomposedValue()); }
Example 5
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testToStringFromDecomposedWithoutSufix() { String name = "my_column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromDecomposed(name, decomposedValue, type); Assert.assertEquals("Column{fullName=my_column, composedValue=5, type=LongType}", column.toString()); }
Example 6
Source File: ColumnTest.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Test public void testToStringFromDecomposedWithSufix() { String name = "my"; String sufix = "column"; LongType type = LongType.instance; Long composedValue = 5L; ByteBuffer decomposedValue = type.decompose(composedValue); Column<Long> column = Column.fromDecomposed(name, sufix, decomposedValue, type); Assert.assertEquals("Column{fullName=my.column, composedValue=5, type=LongType}", column.toString()); }