public final class DefaultCodecs extends Object implements Codecs, CodecRegistry
Codec implementation. Delegates to type-specific codec implementations.| Constructor and Description |
|---|
DefaultCodecs(io.netty.buffer.ByteBufAllocator byteBufAllocator)
Creates a new instance of
DefaultCodecs. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFirst(Codec<?> codec)
Register codec before all other codecs.
|
void |
addLast(Codec<?> codec)
Register codec after all other codecs.
|
<T> T |
decode(io.netty.buffer.ByteBuf buffer,
int dataType,
io.r2dbc.postgresql.message.Format format,
Class<? extends T> type)
Decode a data to a value.
|
io.r2dbc.postgresql.client.Parameter |
encode(Object value)
Encode a value.
|
io.r2dbc.postgresql.client.Parameter |
encodeNull(Class<?> type)
Encode a
null value. |
Iterator<Codec<?>> |
iterator() |
Class<?> |
preferredType(int dataType,
io.r2dbc.postgresql.message.Format format)
Returns the preferred Java type for a given data type and format.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic DefaultCodecs(io.netty.buffer.ByteBufAllocator byteBufAllocator)
DefaultCodecs.byteBufAllocator - the ByteBufAllocator to use for encodingpublic void addFirst(Codec<?> codec)
CodecRegistryaddFirst in interface CodecRegistrycodec - the codec to registerpublic void addLast(Codec<?> codec)
CodecRegistryaddLast in interface CodecRegistrycodec - the codec to register@Nullable public <T> T decode(@Nullable io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends T> type)
Codecspublic io.r2dbc.postgresql.client.Parameter encode(Object value)
Codecspublic io.r2dbc.postgresql.client.Parameter encodeNull(Class<?> type)
Codecsnull value.encodeNull in interface Codecstype - the type to encodepublic Class<?> preferredType(int dataType, io.r2dbc.postgresql.message.Format format)
CodecspreferredType in interface CodecsdataType - the data type fo the dataformat - the format of the dataCopyright © 2020. All rights reserved.