/** * Decompose. * * @param value * the value * @param clazz * the clazz * @return the object */ private static Object decompose(Object value, Class clazz) { ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length); return ByteBufferUtil.toInt(buf); } }
if (columnName.equals("ttl(PERSON_NAME)")) Assert.assertEquals(5, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); personNameFound = true; Assert.assertEquals(5, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); ageFound = true; if (columnName.equals("ttl(PERSON_NAME)")) Assert.assertEquals(10, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); personNameFound = true; if (columnName.equals("ttl(PERSON_NAME)")) Assert.assertEquals(10, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); personNameFound = true; Assert.assertEquals(10, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); ageFound = true; if (columnName.equals("ttl(PERSON_NAME)")) Assert.assertEquals(10, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); personNameFound = true; Assert.assertEquals(10, ByteBufferUtil.toInt(ByteBuffer.wrap(column.getValue()))); ageFound = true;
private static Object decompose(Object value, Class clazz) { ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length); return ByteBufferUtil.toInt(buf); } }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
Assert.assertEquals(BytesType.class.getName(), Boolean.getBoolean(ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(10).getValue())))); Assert.assertEquals("max_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(17).getName()))); Assert.assertEquals(16, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(17).getValue()))); Assert.assertEquals("min_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(18).getName()))); Assert.assertEquals(64, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(18).getValue()))); Assert.assertEquals("replicate_on_write", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getName()))); Assert.assertEquals("true", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getValue()))); Assert.assertEquals(BytesType.class.getName(), Boolean.getBoolean(ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(10).getValue())))); Assert.assertEquals("max_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(17).getName()))); Assert.assertEquals(4, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(17).getValue()))); Assert.assertEquals("min_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(18).getName()))); Assert.assertEquals(32, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(18).getValue()))); Assert.assertEquals("replicate_on_write", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getName()))); Assert.assertEquals("true", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getValue()))); Assert.assertEquals(BytesType.class.getName(), Boolean.getBoolean(ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(10).getValue())))); Assert.assertEquals("max_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(17).getName()))); Assert.assertEquals(16, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(17).getValue()))); Assert.assertEquals("min_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(18).getName()))); Assert.assertEquals(64, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(18).getValue()))); Assert.assertEquals("replicate_on_write", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getName()))); Assert.assertEquals("true", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(21).getValue()))); Assert.assertEquals(BytesType.class.getName(), Boolean.getBoolean(ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(10).getValue())))); Assert.assertEquals("max_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(17).getName()))); Assert.assertEquals(16, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(17).getValue()))); Assert.assertEquals("min_compaction_threshold", ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.getColumns().get(18).getName()))); Assert.assertEquals(64, ByteBufferUtil.toInt(ByteBuffer.wrap(cqlRow.getColumns().get(18).getValue())));
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
public Integer deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toInt(bytes); }
static int getListIndex(ByteBuffer collectionElement) throws InvalidRequestException { int idx = ByteBufferUtil.toInt(collectionElement); if (idx < 0) throw new InvalidRequestException(String.format("Invalid negative list index %d", idx)); return idx; }
public long toTimeInMillis(ByteBuffer buffer) throws MarshalException { return SimpleDateSerializer.dayToTimeInMillis(ByteBufferUtil.toInt(buffer)); }
static int getListIndex(ByteBuffer collectionElement) throws InvalidRequestException { int idx = ByteBufferUtil.toInt(collectionElement); if (idx < 0) throw new InvalidRequestException(String.format("Invalid negative list index %d", idx)); return idx; }
static int getListIndex(ByteBuffer collectionElement) throws InvalidRequestException { int idx = ByteBufferUtil.toInt(collectionElement); if (idx < 0) throw new InvalidRequestException(String.format("Invalid negative list index %d", idx)); return idx; }
public long toTimeInMillis(ByteBuffer buffer) throws MarshalException { return SimpleDateSerializer.dayToTimeInMillis(ByteBufferUtil.toInt(buffer)); }
static int getListIndex(ByteBuffer collectionElement) throws InvalidRequestException { int idx = ByteBufferUtil.toInt(collectionElement); if (idx < 0) throw new InvalidRequestException(String.format("Invalid negative list index %d", idx)); return idx; }
public long toTimeInMillis(ByteBuffer buffer) throws MarshalException { return SimpleDateSerializer.dayToTimeInMillis(ByteBufferUtil.toInt(buffer)); }
public long toTimeInMillis(ByteBuffer buffer) throws MarshalException { return SimpleDateSerializer.dayToTimeInMillis(ByteBufferUtil.toInt(buffer)); }