public class TypeCodecs extends Object
Constructor and Description |
---|
TypeCodecs() |
Modifier and Type | Method and Description |
---|---|
static TypeCodec<ByteBuffer> |
custom(DataType cqlType) |
static <T> TypeCodec<List<T>> |
listOf(TypeCodec<T> elementCodec) |
static <K,V> TypeCodec<Map<K,V>> |
mapOf(TypeCodec<K> keyCodec,
TypeCodec<V> valueCodec) |
static <T> TypeCodec<Set<T>> |
setOf(TypeCodec<T> elementCodec) |
static TypeCodec<TupleValue> |
tupleOf(TupleType cqlType) |
static TypeCodec<UdtValue> |
udtOf(UserDefinedType cqlType) |
static TypeCodec<ZonedDateTime> |
zonedTimestampAt(ZoneId timeZone)
Returns a codec that handles Apache Cassandra(R)'s timestamp type and maps it to Java's
ZonedDateTime , using the supplied ZoneId as its source of time zone information. |
public static final PrimitiveBooleanCodec BOOLEAN
public static final PrimitiveByteCodec TINYINT
public static final PrimitiveDoubleCodec DOUBLE
public static final PrimitiveLongCodec COUNTER
public static final PrimitiveFloatCodec FLOAT
public static final PrimitiveIntCodec INT
public static final PrimitiveLongCodec BIGINT
public static final PrimitiveShortCodec SMALLINT
public static final TypeCodec<ZonedDateTime> ZONED_TIMESTAMP_SYSTEM
ZonedDateTime
, using the system's default time zone as its
source of time zone information.
Note that Apache Cassandra(R)'s timestamp type does not store any time zone; this codec is provided merely as a convenience for users that need to deal with zoned timestamps in their applications.
ZONED_TIMESTAMP_UTC
,
zonedTimestampAt(ZoneId)
public static final TypeCodec<ZonedDateTime> ZONED_TIMESTAMP_UTC
ZonedDateTime
, using ZoneOffset.UTC
as its source of time zone information.
Note that Apache Cassandra(R)'s timestamp type does not store any time zone; this codec is provided merely as a convenience for users that need to deal with zoned timestamps in their applications.
ZONED_TIMESTAMP_SYSTEM
,
zonedTimestampAt(ZoneId)
public static final TypeCodec<ByteBuffer> BLOB
public static final TypeCodec<BigInteger> VARINT
public static final TypeCodec<BigDecimal> DECIMAL
public static final TypeCodec<InetAddress> INET
public static final TypeCodec<CqlDuration> DURATION
@NonNull public static TypeCodec<ByteBuffer> custom(@NonNull DataType cqlType)
@NonNull public static <K,V> TypeCodec<Map<K,V>> mapOf(@NonNull TypeCodec<K> keyCodec, @NonNull TypeCodec<V> valueCodec)
@NonNull public static TypeCodec<TupleValue> tupleOf(@NonNull TupleType cqlType)
@NonNull public static TypeCodec<UdtValue> udtOf(@NonNull UserDefinedType cqlType)
@NonNull public static TypeCodec<ZonedDateTime> zonedTimestampAt(@NonNull ZoneId timeZone)
ZonedDateTime
, using the supplied ZoneId
as its source of time zone information.
Note that Apache Cassandra(R)'s timestamp type does not store any time zone; the codecs created by this method are provided merely as a convenience for users that need to deal with zoned timestamps in their applications.
ZONED_TIMESTAMP_SYSTEM
,
ZONED_TIMESTAMP_UTC
Copyright © 2017–2020. All rights reserved.