Interface Codecs
- All Known Implementing Classes:
DefaultCodecs
public interface Codecs
Encodes and decodes objects.
-
Method Summary
Modifier and TypeMethodDescription<T> @Nullable Tdecode(@Nullable 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.EncodedParameterEncode a value.io.r2dbc.postgresql.client.EncodedParameterencodeNull(Class<?> type) Encode anullvalue.@Nullable Class<?> preferredType(int dataType, io.r2dbc.postgresql.message.Format format) Returns the preferred Java type for a given data type and format.
-
Method Details
-
decode
<T> @Nullable T decode(@Nullable io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends T> type) Decode a data to a value.- Type Parameters:
T- the type of item being returned- Parameters:
buffer- theByteBufto decodedataType- the data type of the dataformat- the format of the datatype- the type to decode to- Returns:
- the decoded value
- Throws:
IllegalArgumentException- ifformatortypeisnull
-
encode
Encode a value.- Parameters:
value- the value to encode- Returns:
- the encoded value
- Throws:
IllegalArgumentException- ifvalueisnull
-
encodeNull
Encode anullvalue.- Parameters:
type- the type to encode- Returns:
- the encoded value
- Throws:
IllegalArgumentException- iftypeisnull
-
preferredType
Returns the preferred Java type for a given data type and format.- Parameters:
dataType- the data type fo the dataformat- the format of the data- Returns:
- the preferred Java type for a given data type and format
- Throws:
IllegalArgumentException- ifformatisnull
-