Record Class TypedOptic.Element<S,T,A,B>

java.lang.Object
java.lang.Record
com.mojang.datafixers.TypedOptic.Element<S,T,A,B>
Enclosing class:
TypedOptic<S,T,A,B>

public static record TypedOptic.Element<S,T,A,B>(Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?,S,T,A,B> optic) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Type<A>
    The field for the aType record component.
    private final Type<B>
    The field for the bType record component.
    private final Optic<?,S,T,A,B>
    The field for the optic record component.
    private final Type<S>
    The field for the sType record component.
    private final Type<T>
    The field for the tType record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Element(Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?,S,T,A,B> optic)
    Creates an instance of a Element record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the aType record component.
    Returns the value of the bType record component.
    <S2,T2> TypedOptic.Element<S2,T2,A,B>
    castOuterUnchecked(Type<S2> sType, Type<T2> tType)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Optic<?,S,T,A,B>
    Returns the value of the optic record component.
    Returns the value of the sType record component.
    Returns a string representation of this record class.
    Returns the value of the tType record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • sType

      private final Type<S> sType
      The field for the sType record component.
    • tType

      private final Type<T> tType
      The field for the tType record component.
    • aType

      private final Type<A> aType
      The field for the aType record component.
    • bType

      private final Type<B> bType
      The field for the bType record component.
    • optic

      private final Optic<?,S,T,A,B> optic
      The field for the optic record component.
  • Constructor Details

    • Element

      public Element(Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?,S,T,A,B> optic)
      Creates an instance of a Element record class.
      Parameters:
      sType - the value for the sType record component
      tType - the value for the tType record component
      aType - the value for the aType record component
      bType - the value for the bType record component
      optic - the value for the optic record component
  • Method Details

    • castOuterUnchecked

      public <S2,T2> TypedOptic.Element<S2,T2,A,B> castOuterUnchecked(Type<S2> sType, Type<T2> tType)
    • toString

      public 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.
    • sType

      public Type<S> sType()
      Returns the value of the sType record component.
      Returns:
      the value of the sType record component
    • tType

      public Type<T> tType()
      Returns the value of the tType record component.
      Returns:
      the value of the tType record component
    • aType

      public Type<A> aType()
      Returns the value of the aType record component.
      Returns:
      the value of the aType record component
    • bType

      public Type<B> bType()
      Returns the value of the bType record component.
      Returns:
      the value of the bType record component
    • optic

      public Optic<?,S,T,A,B> optic()
      Returns the value of the optic record component.
      Returns:
      the value of the optic record component