Record Class TypeDescriptor.Simple
java.lang.Object
java.lang.Record
com.soulfiremc.server.script.TypeDescriptor.Simple
- All Implemented Interfaces:
TypeDescriptor
- Enclosing interface:
TypeDescriptor
A simple, non-parameterized type (e.g., NUMBER, STRING, BOT).
-
Nested Class Summary
Nested classes/interfaces inherited from interface TypeDescriptor
TypeDescriptor.Parameterized, TypeDescriptor.Simple, TypeDescriptor.TypeVariable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseType()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.resolve(Map<String, TypeDescriptor> bindings) Resolves type variables using the given bindings.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Simple
Creates an instance of aSimplerecord class.- Parameters:
type- the value for thetyperecord 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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-