Package net.kyori.adventure.util
Interface Codec<D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable>
-
- Type Parameters:
D
- the decoded typeE
- the encoded typeDX
- the decode exception typeEX
- the encode exception type
public interface Codec<D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable>
A combination encoder and decoder.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Codec.Decoder<D,E,X extends java.lang.Throwable>
A decoder.static interface
Codec.Encoder<D,E,X extends java.lang.Throwable>
An encoder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description static <D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable>
@NotNull Codec<D,E,DX,EX>codec(@NotNull Codec.Decoder<D,E,DX> decoder, @NotNull Codec.Encoder<D,E,EX> encoder)
Creates a codec.D
decode(E encoded)
Decodes.E
encode(D decoded)
Encodes.static <D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable>
@NotNull Codec<D,E,DX,EX>of(@NotNull Codec.Decoder<D,E,DX> decoder, @NotNull Codec.Encoder<D,E,EX> encoder)
Deprecated.for removal since 4.10.0, usecodec(Codec.Decoder, Codec.Encoder)
instead.
-
-
-
Method Detail
-
codec
@NotNull static <D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable> @NotNull Codec<D,E,DX,EX> codec(@NotNull @NotNull Codec.Decoder<D,E,DX> decoder, @NotNull @NotNull 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
-
of
@Deprecated @ScheduledForRemoval(inVersion="5.0.0") @NotNull static <D,E,DX extends java.lang.Throwable,EX extends java.lang.Throwable> @NotNull Codec<D,E,DX,EX> of(@NotNull @NotNull Codec.Decoder<D,E,DX> decoder, @NotNull @NotNull Codec.Encoder<D,E,EX> encoder)
Deprecated.for removal since 4.10.0, usecodec(Codec.Decoder, Codec.Encoder)
instead.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.0.0
-
-