Record Class CodecGrouper6<CI1,CI2,CI3,CI4,CI5,CI6,O>

java.lang.Object
java.lang.Record
net.luis.utils.io.codec.group.grouper.CodecGrouper6<CI1,CI2,CI3,CI4,CI5,CI6,O>
Type Parameters:
CI1 - The type of the first component
CI2 - The type of the second component
CI3 - The type of the third component
CI4 - The type of the fourth component
CI5 - The type of the fifth component
CI6 - The type of the sixth component
O - The type of the resulting object this grouper is for
Record Components:
codec1 - The first codec
codec2 - The second codec
codec3 - The third codec
codec4 - The fourth codec
codec5 - The fifth codec
codec6 - The sixth codec

public record CodecGrouper6<CI1,CI2,CI3,CI4,CI5,CI6,O>(@NotNull ConfiguredCodec<CI1,O> codec1, @NotNull ConfiguredCodec<CI2,O> codec2, @NotNull ConfiguredCodec<CI3,O> codec3, @NotNull ConfiguredCodec<CI4,O> codec4, @NotNull ConfiguredCodec<CI5,O> codec5, @NotNull ConfiguredCodec<CI6,O> codec6) extends Record
Represents a group of six codecs.
The grouper is used for creating a new single codec that encodes and decodes a value of a specific type.
Each codec is responsible for encoding and decoding a specific component (field) of the value.
The grouped codec is created by providing a function that creates the value from the decoded components.
  • Field Details

  • Constructor Details

  • Method Details

    • create

      @NotNull public @NotNull Codec<O> create(@NotNull @NotNull CodecGroupingFunction6<CI1,CI2,CI3,CI4,CI5,CI6,O> function)
      Creates a new codec using the codecs of this grouper and the provided grouping function.
      The grouping function is used to create the resulting object from the decoded components.
      Parameters:
      function - The grouping function
      Returns:
      The created codec
      Throws:
      NullPointerException - If the provided grouping function is null
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • codec1

      @NotNull public @NotNull ConfiguredCodec<CI1,O> codec1()
      Returns the value of the codec1 record component.
      Returns:
      the value of the codec1 record component
    • codec2

      @NotNull public @NotNull ConfiguredCodec<CI2,O> codec2()
      Returns the value of the codec2 record component.
      Returns:
      the value of the codec2 record component
    • codec3

      @NotNull public @NotNull ConfiguredCodec<CI3,O> codec3()
      Returns the value of the codec3 record component.
      Returns:
      the value of the codec3 record component
    • codec4

      @NotNull public @NotNull ConfiguredCodec<CI4,O> codec4()
      Returns the value of the codec4 record component.
      Returns:
      the value of the codec4 record component
    • codec5

      @NotNull public @NotNull ConfiguredCodec<CI5,O> codec5()
      Returns the value of the codec5 record component.
      Returns:
      the value of the codec5 record component
    • codec6

      @NotNull public @NotNull ConfiguredCodec<CI6,O> codec6()
      Returns the value of the codec6 record component.
      Returns:
      the value of the codec6 record component