T
- the type that is handled by this codec.public interface Codec<T>
Format
.
Codecs can decode one or more server-specific data types and represent them as a specific Java type
. The type parameter of Codec
indicates the interchange type that is handled by this codec.
PostgresqlObjectId
Modifier and Type | Method and Description |
---|---|
boolean |
canDecode(int dataType,
io.r2dbc.postgresql.message.Format format,
Class<?> type)
|
boolean |
canEncode(Object value)
Determine whether this
Codec is capable of encoding the value . |
boolean |
canEncodeNull(Class<?> type)
|
T |
decode(io.netty.buffer.ByteBuf buffer,
int dataType,
io.r2dbc.postgresql.message.Format format,
Class<? extends T> type)
Decode the
buffer and return it as the requested type . |
io.r2dbc.postgresql.client.Parameter |
encode(Object value)
Encode the
value to be used as RPC parameter. |
io.r2dbc.postgresql.client.Parameter |
encodeNull()
Encode a
null value. |
Class<?> |
type()
Returns the Java
type of this codec. |
boolean canDecode(int dataType, io.r2dbc.postgresql.message.Format format, Class<?> type)
Codec
is capable of decoding a value for the given dataType
and Format
and whether it can represent the decoded value as the desired
type
.dataType
- the dataType to decodeformat
- the data type Format
, text or binarytype
- the desired value typetrue
if this codec is able to decode values for tge given dataType
and Format
boolean canEncode(Object value)
Codec
is capable of encoding the value
.value
- the parameter valuetrue
if this Codec
is able to encode the value
.encodeNull()
boolean canEncodeNull(Class<?> type)
type
- the desired value typetrue
if this Codec
is able to encode null
values for the given Class
type.encodeNull()
@Nullable T decode(@Nullable io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends T> type)
buffer
and return it as the requested type
.buffer
- the data bufferdataType
- the dataType to decodeformat
- the data type Format
, text or binarytype
- the desired value typenull
if the value is null
.io.r2dbc.postgresql.client.Parameter encode(Object value)
value
to be used as RPC parameter.value
- the null
value
io.r2dbc.postgresql.client.Parameter encodeNull()
null
value.null
valueCopyright © 2021. All rights reserved.