public final class StringCodec extends Object
| Constructor and Description |
|---|
StringCodec(io.netty.buffer.ByteBufAllocator byteBufAllocator) |
StringCodec(io.netty.buffer.ByteBufAllocator byteBufAllocator,
PostgresTypeIdentifier defaultType,
PostgresTypeIdentifier arrayType) |
| 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. |
T |
decode(io.netty.buffer.ByteBuf buffer,
PostgresTypeIdentifier dataType,
io.r2dbc.postgresql.message.Format format,
Class<? extends T> type)
Decode the
buffer and return it as the requested type. |
T |
decode(io.netty.buffer.ByteBuf buffer,
PostgresTypeIdentifier dataType,
io.r2dbc.postgresql.message.Format format,
Class<? extends T> type)
Forwarding method to
doDecode(ByteBuf, PostgresTypeIdentifier, Format, Class) for subclasses that want to implement ArrayCodecDelegate. |
io.r2dbc.postgresql.client.EncodedParameter |
encode(Object value)
Encode the
value to be used as RPC parameter. |
io.r2dbc.postgresql.client.EncodedParameter |
encode(Object value,
int dataType)
Encode the
value to be used as RPC parameter. |
io.r2dbc.postgresql.client.EncodedParameter |
encodeNull()
Encode a
null value. |
io.r2dbc.postgresql.client.EncodedParameter |
encodeNull(int dataType) |
String |
encodeToText(String value)
Encode the
value to be used as parameter to be used as array element. |
PostgresTypeIdentifier |
getArrayDataType()
Return the array data type to be used when creating the encoded form of the array.
|
static PostgresTypeIdentifier |
getDataType(int dataType) |
Iterable<PostgresTypeIdentifier> |
getDataTypes()
Returns the collection of
PostgresTypeIdentifier this codec can handle |
Class<?> |
type()
Returns the Java
type of this codec. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormats, typepublic StringCodec(io.netty.buffer.ByteBufAllocator byteBufAllocator)
public StringCodec(io.netty.buffer.ByteBufAllocator byteBufAllocator,
PostgresTypeIdentifier defaultType,
PostgresTypeIdentifier arrayType)
public io.r2dbc.postgresql.client.EncodedParameter encodeNull()
Codecnull value.encodeNull in interface Codec<String>null valuepublic String encodeToText(String value)
value to be used as parameter to be used as array element.value - the valuepublic PostgresTypeIdentifier getArrayDataType()
public Iterable<PostgresTypeIdentifier> getDataTypes()
CodecMetadataPostgresTypeIdentifier this codec can handlegetDataTypes in interface CodecMetadata@Nullable public T decode(io.netty.buffer.ByteBuf buffer, PostgresTypeIdentifier dataType, io.r2dbc.postgresql.message.Format format, Class<? extends T> type)
buffer and return it as the requested type.buffer - the data bufferdataType - the Postgres OID to encodeformat - the data type Format, text or binarytype - the desired value typenull if the value is null.public boolean canDecode(int dataType,
io.r2dbc.postgresql.message.Format format,
Class<?> type)
Codecpublic boolean canEncode(Object value)
CodecCodec is capable of encoding the value.canEncode in interface Codec<T>value - the parameter valuetrue if this Codec is able to encode the value.Codec.encode(java.lang.Object)public boolean canEncodeNull(Class<?> type)
CodeccanEncodeNull in interface Codec<T>type - the desired value typetrue if this Codec is able to encode null values for the given Class type.Codec.encodeNull()@Nullable public final T decode(@Nullable io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends T> type)
Codecbuffer and return it as the requested type.public final io.r2dbc.postgresql.client.EncodedParameter encode(Object value)
Codecvalue to be used as RPC parameter.public io.r2dbc.postgresql.client.EncodedParameter encode(Object value, int dataType)
Codecvalue to be used as RPC parameter.public static PostgresTypeIdentifier getDataType(int dataType)
public io.r2dbc.postgresql.client.EncodedParameter encodeNull(int dataType)
public Class<?> type()
CodecMetadatatype of this codec.type in interface CodecMetadatapublic T decode(io.netty.buffer.ByteBuf buffer,
PostgresTypeIdentifier dataType,
io.r2dbc.postgresql.message.Format format,
Class<? extends T> type)
doDecode(ByteBuf, PostgresTypeIdentifier, Format, Class) for subclasses that want to implement ArrayCodecDelegate.buffer - the data bufferdataType - the well-known type OIDformat - data type formattype - the desired value typenull if the column value is nullCopyright © 2023. All rights reserved.