T
- The wrapped Java typepublic class OptionalCodec<T> extends MappingCodec<Optional<T>,T>
Optional
API.TypeCodec.AbstractCollectionCodec<E,C extends 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
innerCodec
Constructor and Description |
---|
OptionalCodec(TypeCodec<T> codec) |
OptionalCodec(TypeCodec<T> codec,
Predicate<T> isAbsent) |
Modifier and Type | Method and Description |
---|---|
protected T |
absentValue() |
protected Optional<T> |
deserialize(T value) |
protected boolean |
isAbsent(T value) |
protected T |
serialize(Optional<T> value) |
deserialize, format, parse, serialize
accepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varint
protected Optional<T> deserialize(T value)
deserialize
in class MappingCodec<Optional<T>,T>
protected T serialize(Optional<T> value)
serialize
in class MappingCodec<Optional<T>,T>
protected T absentValue()
protected boolean isAbsent(T value)