public ByteBuffer getByteBuffer ( ) throws InvalidRequestException { switch ( type ) { case STRING : return AsciiType . instance . fromString ( text ) ; case INTEGER : return IntegerType . instance . fromString ( text ) ; case UUID : // we specifically want the Lexical class here, not "UUIDType," because we're supposed to have // a uuid-shaped string here, and UUIDType also accepts integer or date strings (and turns them into version 1 uuids). return LexicalUUIDType . instance . fromString ( text ) ; case FLOAT : return FloatType . instance . fromString ( text ) ; } // FIXME: handle scenario that should never happen return null ; }
Returns the typed value serialized to a ByteBuffer .