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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface TypeDescriptor
TypeDescriptor.Parameterized, TypeDescriptor.Simple, TypeDescriptor.TypeVariable -
Constructor Summary
ConstructorsConstructorDescriptionParameterized(PortType base, List<TypeDescriptor> params) Creates an instance of aParameterizedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()Returns the value of thebaserecord component.baseType()Returns the base PortType for backward compatibility.Returns a human-readable representation like "List" or "T". final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks whether this descriptor contains any type variables.params()Returns the value of theparamsrecord component.resolve(Map<String, TypeDescriptor> bindings) Resolves type variables using the given bindings.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Parameterized
Creates an instance of aParameterizedrecord class.- Parameters:
base- the value for thebaserecord componentparams- the value for theparamsrecord component
-
-
Method Details
-
baseType
Description copied from interface:TypeDescriptorReturns the base PortType for backward compatibility. Simple returns its type, Parameterized returns its base, TypeVariable returns ANY.- Specified by:
baseTypein interfaceTypeDescriptor
-
displayString
Description copied from interface:TypeDescriptorReturns a human-readable representation like "List" or "T". - Specified by:
displayStringin interfaceTypeDescriptor
-
resolve
Description copied from interface:TypeDescriptorResolves type variables using the given bindings. Returns a new TypeDescriptor with all known variables replaced.- Specified by:
resolvein interfaceTypeDescriptor
-
hasTypeVariables
public boolean hasTypeVariables()Description copied from interface:TypeDescriptorChecks whether this descriptor contains any type variables.- Specified by:
hasTypeVariablesin interfaceTypeDescriptor
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
base
Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
params
Returns the value of theparamsrecord component.- Returns:
- the value of the
paramsrecord component
-