use of org.apache.cassandra.db.marshal.CompositeType in project stargate-core by tuplejump.
the class FieldCreator method toString.
public static String toString(ByteBuffer byteBuffer, AbstractType<?> type) {
if (type instanceof CompositeType) {
CompositeType composite = (CompositeType) type;
List<AbstractType<?>> types = composite.types;
ByteBuffer[] components = composite.split(byteBuffer);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < components.length; i++) {
AbstractType<?> componentType = types.get(i);
ByteBuffer component = components[i];
sb.append(componentType.compose(component));
if (i < types.size() - 1) {
sb.append(':');
}
}
return sb.toString();
} else {
return type.compose(byteBuffer).toString();
}
}
Aggregations