Class TypeCodec.PrimitiveBooleanCodec
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.types.TypeCodec<java.lang.Boolean>
-
- org.apache.cassandra.cql3.functions.types.TypeCodec.PrimitiveBooleanCodec
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.cql3.functions.types.TypeCodec
TypeCodec.AbstractCollectionCodec<E,C extends java.util.Collection<E>>, TypeCodec.AbstractMapCodec<K,V>, TypeCodec.AbstractTupleCodec<T>, TypeCodec.AbstractUDTCodec<T>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
deserialize(java.nio.ByteBuffer bytes, ProtocolVersion protocolVersion)
Deserialize the givenByteBuffer
instance according to the CQL type handled by this codec.abstract boolean
deserializeNoBoxing(java.nio.ByteBuffer v, ProtocolVersion protocolVersion)
java.nio.ByteBuffer
serialize(java.lang.Boolean value, ProtocolVersion protocolVersion)
Serialize the given value according to the CQL type handled by this codec.abstract java.nio.ByteBuffer
serializeNoBoxing(boolean v, ProtocolVersion protocolVersion)
-
Methods inherited from class org.apache.cassandra.cql3.functions.types.TypeCodec
accepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, format, getCqlType, getJavaType, inet, list, map, parse, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varint
-
-
-
-
Method Detail
-
serializeNoBoxing
public abstract java.nio.ByteBuffer serializeNoBoxing(boolean v, ProtocolVersion protocolVersion)
-
deserializeNoBoxing
public abstract boolean deserializeNoBoxing(java.nio.ByteBuffer v, ProtocolVersion protocolVersion)
-
serialize
public java.nio.ByteBuffer serialize(java.lang.Boolean value, ProtocolVersion protocolVersion)
Description copied from class:TypeCodec
Serialize the given value according to the CQL type handled by this codec.Implementation notes:
- Null values should be gracefully handled and no exception should be raised; these should be considered as the equivalent of a NULL CQL value;
- Codecs for CQL collection types should not permit null elements;
- Codecs for CQL collection types should treat a
null
input as the equivalent of an empty collection.
- Specified by:
serialize
in classTypeCodec<java.lang.Boolean>
- Parameters:
value
- An instance of T; may benull
.protocolVersion
- the protocol version to use when serializingbytes
. In most cases, the proper value to provide for this argument is the value returned byProtocolOptions#getProtocolVersion
(which is the protocol version in use by the driver).- Returns:
- A
ByteBuffer
instance containing the serialized form of T
-
deserialize
public java.lang.Boolean deserialize(java.nio.ByteBuffer bytes, ProtocolVersion protocolVersion)
Description copied from class:TypeCodec
Deserialize the givenByteBuffer
instance according to the CQL type handled by this codec.Implementation notes:
- Null or empty buffers should be gracefully handled and no exception should be raised;
these should be considered as the equivalent of a NULL CQL value and, in most cases,
should map to
null
or a default value for the corresponding Java type, if applicable; - Codecs for CQL collection types should clearly document whether they return immutable collections or not (note that the driver's default collection codecs return mutable collections);
- Codecs for CQL collection types should avoid returning
null
; they should return empty collections instead (the driver's default collection codecs all comply with this rule). - The provided
ByteBuffer
should never be consumed by read operations that modify its current position; if necessary,ByteBuffer.duplicate()
duplicate} it before consuming.
- Specified by:
deserialize
in classTypeCodec<java.lang.Boolean>
- Parameters:
bytes
- AByteBuffer
instance containing the serialized form of T; may benull
or empty.protocolVersion
- the protocol version to use when serializingbytes
. In most cases, the proper value to provide for this argument is the value returned byProtocolOptions#getProtocolVersion
(which is the protocol version in use by the driver).- Returns:
- An instance of T
- Null or empty buffers should be gracefully handled and no exception should be raised;
these should be considered as the equivalent of a NULL CQL value and, in most cases,
should map to
-
-