Class EncoderPair<T>

java.lang.Object
de.craftsblock.craftsnet.api.codec.CodecPair<T,Encoder<T,?>>
de.craftsblock.craftsnet.api.codec.EncoderPair<T>
Type Parameters:
T - The target type to be encoded.

@Experimental public final class EncoderPair<T> extends CodecPair<T,Encoder<T,?>>
A pairing between a specific target type and its associated Encoder.

This class allows registration or lookup of encoders based on the target type they support.

Since:
3.5.0
See Also:
  • Constructor Details

    • EncoderPair

      public EncoderPair(Class<T> target, Encoder<T,?> codec)
      Constructs a new EncoderPair for the given target type and encoder.
      Parameters:
      target - The type the encoder can encode.
      codec - The encoder instance.