Package io.activej.codec
Interface StructuredCodec<T>
- All Superinterfaces:
StructuredDecoder<T>,StructuredEncoder<T>
- All Known Implementing Classes:
CodecSubtype
public interface StructuredCodec<T> extends StructuredEncoder<T>, StructuredDecoder<T>
A structured codec is an object that describes how some type T
can be written into
StructuredOutput or read from StructuredInput.
The actual representation is abstracted away, so the same codec can be used to write or read
an object into/from various formats and protocols.-
Method Summary
Modifier and Type Method Description default StructuredCodec<@Nullable T>nullable()static <T> StructuredCodec<T>of(StructuredDecoder<T> decoder, StructuredEncoder<T> encoder)default StructuredCodec<List<T>>ofList()static <T> StructuredCodec<T>ofObject(StructuredDecoder<T> decoder, StructuredEncoder<T> encoder)static <T> StructuredCodec<T>ofObject(Supplier<T> supplier)static <T> StructuredCodec<T>ofTuple(StructuredDecoder<T> decoder, StructuredEncoder<T> encoder)default <R> StructuredCodec<R>transform(DecoderFunction<T,R> reader, Function<R,T> writer)Methods inherited from interface io.activej.codec.StructuredDecoder
decodeMethods inherited from interface io.activej.codec.StructuredEncoder
encode
-
Method Details
-
of
-
ofObject
-
ofObject
-
ofTuple
-
nullable
-
ofList
-
transform
-