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
  • 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