Module net.kyori.adventure.api
Package net.kyori.adventure.util
Interface Codec<D,E,DX extends Throwable,EX extends Throwable>
- Type Parameters:
D- the decoded typeE- the encoded typeDX- the decode exception typeEX- the encode exception type
A combination encoder and decoder.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCodec.Decoder<D,E, X extends Throwable> A decoder.static interfaceCodec.Encoder<D,E, X extends Throwable> An encoder. -
Method Summary
-
Method Details
-
codec
static <D,E, Codec<D,DX extends Throwable, EX extends Throwable> E, codecDX, EX> (Codec.Decoder<D, E, DX> decoder, Codec.Encoder<D, E, EX> encoder) Creates a codec.- Type Parameters:
D- the decoded typeE- the encoded typeDX- the decode exception typeEX- the encode exception type- Parameters:
decoder- the decoderencoder- the encoder- Returns:
- a codec
- Since:
- 4.10.0
-
decode
Decodes.- Parameters:
encoded- the encoded input- Returns:
- the decoded value
- Throws:
DX- if an exception is encountered while decoding- Since:
- 4.0.0
-
encode
Encodes.- Parameters:
decoded- the decoded value- Returns:
- the encoded output
- Throws:
EX- if an exception is encountered while encoding- Since:
- 4.0.0
-