Record Class NativeTypeInfo.Method
java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.natives.NativeTypeInfo.Method
- Record Components:
name- The name of the method that should be exposed. The name has to be the same as the native method's one.getter- The name of the property that can be used to invoke this method as if it were a ZenCode property, if desired; empty otherwise. E.g., if the method name isgetFoo, specifyingfooas getter means that the method will also be called when the propertyfoois accessed in a getter context in a ZenCode script.setter- The name of the property that can be used to invoke this method as if it were a ZenCode property, if desired; empty otherwise. E.g., if the method name issetFoo, specifyingfooas setter means that the method will also be called when the propertyfoois accessed in a setter context in a ZenCode script.parameters- TheNativeTypeInfo.Parameters accepted by this method.
- Enclosing class:
NativeTypeInfo
public static record NativeTypeInfo.Method(String name, String getter, String setter, NativeTypeInfo.Parameter[] parameters)
extends Record
Holds information relative to a specific native method that should be exposed to ZenCode.
- Since:
- 9.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMethod(String name, NativeTypeInfo.Parameter... parameters) Constructs an instance holding information relative to a native method that should be exposed to ZenCode.Method(String name, String getter, NativeTypeInfo.Parameter... parameters) Constructs an instance holding information relative to a native method that should be exposed to ZenCode.Method(String name, String getter, String setter, NativeTypeInfo.Parameter... parameters) Creates an instance of aMethodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getter()Returns the value of thegetterrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theparametersrecord component.setter()Returns the value of thesetterrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method
Constructs an instance holding information relative to a native method that should be exposed to ZenCode.The created method has no setter alias.
- Parameters:
name- The name of the method that should be exposed. The name has to be the same as the native method's one.getter- The name of the property that can be used to invoke this method as if it were a ZenCode property, if desired; empty otherwise. E.g., if the method name isgetFoo, specifyingfooas getter means that the method will also be called when the propertyfoois accessed in a getter context in a ZenCode script.parameters- TheNativeTypeInfo.Parameters accepted by this method.- Since:
- 9.1.0
-
Method
Constructs an instance holding information relative to a native method that should be exposed to ZenCode.The created method has no setter or getter alias.
- Parameters:
name- The name of the method that should be exposed. The name has to be the same as the native method's one.parameters- TheNativeTypeInfo.Parameters accepted by this method.- Since:
- 9.1.0
-
Method
Creates an instance of aMethodrecord class.- Parameters:
name- the value for thenamerecord componentgetter- the value for thegetterrecord componentsetter- the value for thesetterrecord componentparameters- the value for theparametersrecord component
-
-
Method Details
-
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. -
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. -
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
getter
Returns the value of thegetterrecord component.- Returns:
- the value of the
getterrecord component
-
setter
Returns the value of thesetterrecord component.- Returns:
- the value of the
setterrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-