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, wait
forEach, spliterator
public DefaultCodecs(io.netty.buffer.ByteBufAllocator byteBufAllocator)
DefaultCodecs
.byteBufAllocator
- the ByteBufAllocator
to use for encodingpublic void addFirst(Codec<?> codec)
CodecRegistry
addFirst
in interface CodecRegistry
codec
- the codec to registerpublic void addLast(Codec<?> codec)
CodecRegistry
addLast
in interface CodecRegistry
codec
- 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)
Codecs
public io.r2dbc.postgresql.client.Parameter encode(Object value)
Codecs
public io.r2dbc.postgresql.client.Parameter encodeNull(Class<?> type)
Codecs
null
value.encodeNull
in interface Codecs
type
- the type to encodepublic Class<?> preferredType(int dataType, io.r2dbc.postgresql.message.Format format)
Codecs
preferredType
in interface Codecs
dataType
- the data type fo the dataformat
- the format of the dataCopyright © 2020. All rights reserved.