Class TupleCodecs.Tuple4Codec<A,B,C,D_TYPE>

java.lang.Object
com.github.darksoulq.abyssallib.common.serialization.codecs.TupleCodecs.Tuple4Codec<A,B,C,D_TYPE>
Type Parameters:
A - First element type.
B - Second element type.
C - Third element type.
D_TYPE - Fourth element type.
All Implemented Interfaces:
Codec<Codec.Tuple4<A,B,C,D_TYPE>>
Enclosing class:
TupleCodecs

public static class TupleCodecs.Tuple4Codec<A,B,C,D_TYPE> extends Object implements Codec<Codec.Tuple4<A,B,C,D_TYPE>>
Codec for a four-element tuple.
  • Constructor Details

    • Tuple4Codec

      public Tuple4Codec(Codec<A> first, Codec<B> second, Codec<C> third, Codec<D_TYPE> fourth)
      Creates a four-element tuple codec.
      Parameters:
      first - Codec for the first element.
      second - Codec for the second element.
      third - Codec for the third element.
      fourth - Codec for the fourth element.
  • Method Details

    • decode

      public <D> DataResult<Codec.Tuple4<A,B,C,D_TYPE>> decode(DynamicOps<D> ops, D input)
      Description copied from interface: Codec
      Decodes a serialized input of a specific data format into a Java object.
      Specified by:
      decode in interface Codec<A>
      Type Parameters:
      D - The type of the serialized data.
      Parameters:
      ops - The provider defining how to navigate and read data of type D.
      input - The raw serialized input to be processed.
      Returns:
      A DataResult containing the decoded object or an error state.
    • encode

      public <D> DataResult<D> encode(DynamicOps<D> ops, Codec.Tuple4<A,B,C,D_TYPE> value)
      Description copied from interface: Codec
      Encodes a Java object into its serialized representation.
      Specified by:
      encode in interface Codec<A>
      Type Parameters:
      D - The target type of the serialized data.
      Parameters:
      ops - The provider defining how to construct data of type D.
      value - The Java object instance to be serialized.
      Returns:
      A DataResult containing the serialized data or an error state.
    • describe

      public String describe()
      Description copied from interface: Codec
      Outputs a structural description of the expected format for this codec. Useful for schema generation and validation debugging.
      Specified by:
      describe in interface Codec<A>
      Returns:
      The schema definition representing the target type.
    • accept

      public <R> R accept(CodecVisitor<R> visitor)
      Description copied from interface: Codec
      Routes this instance into the visitor API to construct contextual schema layouts.
      Specified by:
      accept in interface Codec<A>
      Type Parameters:
      R - The layout target natively returning explicitly mapped variants.
      Parameters:
      visitor - The evaluation logic instance.
      Returns:
      Evaluated variant functionally extracting outputs.