Record Class TypeDescriptor.Parameterized

java.lang.Object
java.lang.Record
com.soulfiremc.server.script.TypeDescriptor.Parameterized
All Implemented Interfaces:
TypeDescriptor
Enclosing interface:
TypeDescriptor

public static record TypeDescriptor.Parameterized(PortType base, List<TypeDescriptor> params) extends Record implements TypeDescriptor
A parameterized type like List or Map<K, V>. The base is the container type (LIST, MAP), params are the type arguments.
  • Constructor Details

    • Parameterized

      public Parameterized(PortType base, List<TypeDescriptor> params)
      Creates an instance of a Parameterized record class.
      Parameters:
      base - the value for the base record component
      params - the value for the params record component
  • Method Details

    • baseType

      public PortType baseType()
      Description copied from interface: TypeDescriptor
      Returns the base PortType for backward compatibility. Simple returns its type, Parameterized returns its base, TypeVariable returns ANY.
      Specified by:
      baseType in interface TypeDescriptor
    • displayString

      public String displayString()
      Description copied from interface: TypeDescriptor
      Returns a human-readable representation like "List" or "T".
      Specified by:
      displayString in interface TypeDescriptor
    • resolve

      public TypeDescriptor resolve(Map<String, TypeDescriptor> bindings)
      Description copied from interface: TypeDescriptor
      Resolves type variables using the given bindings. Returns a new TypeDescriptor with all known variables replaced.
      Specified by:
      resolve in interface TypeDescriptor
    • hasTypeVariables

      public boolean hasTypeVariables()
      Description copied from interface: TypeDescriptor
      Checks whether this descriptor contains any type variables.
      Specified by:
      hasTypeVariables in interface TypeDescriptor
    • 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.
    • base

      public PortType base()
      Returns the value of the base record component.
      Returns:
      the value of the base record component
    • params

      public List<TypeDescriptor> params()
      Returns the value of the params record component.
      Returns:
      the value of the params record component