EXTERNAL - The external type (as produced and consumed by the connector)INTERNAL - The internal type (the one that matches the target CQL type)public abstract class ConvertingCodec<EXTERNAL,INTERNAL> extends Object implements TypeCodec<EXTERNAL>
| Modifier and Type | Field and Description |
|---|---|
protected TypeCodec<INTERNAL> |
internalCodec |
protected GenericType<EXTERNAL> |
javaType |
| Modifier | Constructor and Description |
|---|---|
protected |
ConvertingCodec(TypeCodec<INTERNAL> internalCodec,
Class<EXTERNAL> javaType) |
protected |
ConvertingCodec(TypeCodec<INTERNAL> internalCodec,
GenericType<EXTERNAL> javaType) |
| Modifier and Type | Method and Description |
|---|---|
EXTERNAL |
decode(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
ByteBuffer |
encode(EXTERNAL external,
ProtocolVersion protocolVersion) |
abstract INTERNAL |
externalToInternal(EXTERNAL external)
Converts the external representation of a value (i.e., the value, as produced by a connector)
to its internal representation (i.e., the Java type that matches the target CQL type).
|
String |
format(EXTERNAL s) |
DataType |
getCqlType() |
TypeCodec<INTERNAL> |
getInternalCodec() |
GenericType<INTERNAL> |
getInternalJavaType() |
GenericType<EXTERNAL> |
getJavaType() |
abstract EXTERNAL |
internalToExternal(INTERNAL internal)
Converts the internal representation of a value (i.e., the Java type that matches the target
CQL type) to its external representation (i.e., the value, as consumed by a connector).
|
EXTERNAL |
parse(String s) |
protected final GenericType<EXTERNAL> javaType
protected ConvertingCodec(TypeCodec<INTERNAL> internalCodec, Class<EXTERNAL> javaType)
protected ConvertingCodec(TypeCodec<INTERNAL> internalCodec, GenericType<EXTERNAL> javaType)
@NonNull public DataType getCqlType()
getCqlType in interface TypeCodec<EXTERNAL>@NonNull public GenericType<EXTERNAL> getJavaType()
getJavaType in interface TypeCodec<EXTERNAL>public GenericType<INTERNAL> getInternalJavaType()
public ByteBuffer encode(EXTERNAL external, @NonNull ProtocolVersion protocolVersion)
public EXTERNAL decode(ByteBuffer bytes, @NonNull ProtocolVersion protocolVersion)
public abstract INTERNAL externalToInternal(EXTERNAL external)
external - the value's external form.public abstract EXTERNAL internalToExternal(INTERNAL internal)
internal - the value's internal form.Copyright © 2017–2021 DataStax. All rights reserved.