Record Class Term.Repeated<S,T>

java.lang.Object
java.lang.Record
net.minecraft.util.parsing.packrat.Term.Repeated<S,T>
All Implemented Interfaces:
Term<S>
Enclosing interface:
Term<S>

public static record Term.Repeated<S,T>(NamedRule<S,T> element, Atom<List<T>> listName, int minRepetitions) extends Record implements Term<S>
  • Field Details

    • element

      private final NamedRule<S,T> element
      The field for the element record component.
    • listName

      private final Atom<List<T>> listName
      The field for the listName record component.
    • minRepetitions

      private final int minRepetitions
      The field for the minRepetitions record component.
  • Constructor Details

    • Repeated

      public Repeated(NamedRule<S,T> element, Atom<List<T>> listName, int minRepetitions)
      Creates an instance of a Repeated record class.
      Parameters:
      element - the value for the element record component
      listName - the value for the listName record component
      minRepetitions - the value for the minRepetitions record component
  • Method Details

    • parse

      public boolean parse(ParseState<S> p_410665_, Scope p_410752_, Control p_410872_)
      Specified by:
      parse in interface Term<S>
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • element

      public NamedRule<S,T> element()
      Returns the value of the element record component.
      Returns:
      the value of the element record component
    • listName

      public Atom<List<T>> listName()
      Returns the value of the listName record component.
      Returns:
      the value of the listName record component
    • minRepetitions

      public int minRepetitions()
      Returns the value of the minRepetitions record component.
      Returns:
      the value of the minRepetitions record component