Class BinaryDtoConvertingFieldCodec<R,T>
java.lang.Object
io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoBaseFieldCodec<R>
io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoConvertingFieldCodec<R,T>
public class BinaryDtoConvertingFieldCodec<R,T> extends BinaryDtoBaseFieldCodec<R>
-
Constructor Summary
Constructors Constructor Description BinaryDtoConvertingFieldCodec(Codec<R,T> converter, BinaryDtoBaseFieldCodec<T> codec, boolean keyCompatible)BinaryDtoConvertingFieldCodec(Function<R,T> convertTo, Function<T,R> convertFrom, BinaryDtoBaseFieldCodec<T> codec, boolean keyCompatible) -
Method Summary
Modifier and Type Method Description Rdecode(byte[] bytes, int offset, int length)byte[]encode(R value)intfixedLength()booleanisFixedLength()booleansupportsComparableCodec()Override with true if the codec is suitable for comparable encoding.Methods inherited from class io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoBaseFieldCodec
compareAsIfEncoded, decode, isVariableLength
-
Constructor Details
-
BinaryDtoConvertingFieldCodec
-
BinaryDtoConvertingFieldCodec
public BinaryDtoConvertingFieldCodec(Codec<R,T> converter, BinaryDtoBaseFieldCodec<T> codec, boolean keyCompatible)
-
-
Method Details
-
isFixedLength
public boolean isFixedLength()- Overrides:
isFixedLengthin classBinaryDtoBaseFieldCodec<R>
-
fixedLength
public int fixedLength()- Overrides:
fixedLengthin classBinaryDtoBaseFieldCodec<R>
-
supportsComparableCodec
public boolean supportsComparableCodec()Description copied from class:BinaryDtoBaseFieldCodecOverride with true if the codec is suitable for comparable encoding.- Specified by:
supportsComparableCodecin classBinaryDtoBaseFieldCodec<R>
-
encode
- Specified by:
encodein classBinaryDtoBaseFieldCodec<R>
-
decode
- Specified by:
decodein classBinaryDtoBaseFieldCodec<R>
-