T
- The wrapped Java typepublic class OptionalCodec<T> extends MappingCodec<com.google.common.base.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,
com.google.common.base.Predicate<T> isAbsent) |
Modifier and Type | Method and Description |
---|---|
protected T |
absentValue() |
protected com.google.common.base.Optional<T> |
deserialize(T value) |
protected boolean |
isAbsent(T value) |
protected T |
serialize(com.google.common.base.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 com.google.common.base.Optional<T> deserialize(T value)
deserialize
in class MappingCodec<com.google.common.base.Optional<T>,T>
protected T serialize(com.google.common.base.Optional<T> value)
serialize
in class MappingCodec<com.google.common.base.Optional<T>,T>
protected T absentValue()
protected boolean isAbsent(T value)