Record Class NativeTypeInfo
java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.natives.NativeTypeInfo
- Record Components:
name- The fully qualified name of the class as exposed to ZenCode. It does not have to match the actual name.targetedType- The native class this native type information is for.constructors-NativeTypeInfo.Constructors that ZenCode should know about, allowing them to be used in scripts.methods-NativeTypeInfo.Methods that ZenCode should know about, allowing them to be used in scripts.
public record NativeTypeInfo(String name, Class<?> targetedType, NativeTypeInfo.Constructor[] constructors, NativeTypeInfo.Method[] methods)
extends Record
Holds information relative to a specific native type that is yet to be registered to ZenCode.
This record is used as a holder to store all information related to a specific native type, providing thus a uniform interface from which CraftTweaker is able to read information and bake data necessary to properly provide information to the ZenCode scripting engine.
Once all information has been used to build a well-formed type, instances of the ZenCode data will be available
through the INativeTypeRegistry.
- Since:
- 9.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHolds information relative to a specific native constructor that should be exposed to ZenCode.static final recordHolds information relative to a specific native method that should be exposed to ZenCode.static final recordHolds information relative to a specific parameter of a native method or native constructor that is exposed to ZenCode. -
Constructor Summary
ConstructorsConstructorDescriptionNativeTypeInfo(String name, Class<?> targetedType, NativeTypeInfo.Constructor... constructors) Creates an instance holding information relative to a specific native type that should be exposed to ZenCode.NativeTypeInfo(String name, Class<?> targetedType, NativeTypeInfo.Constructor[] constructors, NativeTypeInfo.Method... methods) Creates an instance of aNativeTypeInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstructorsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.methods()Returns the value of themethodsrecord component.name()Returns the value of thenamerecord component.Class<?> Returns the value of thetargetedTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NativeTypeInfo
public NativeTypeInfo(String name, Class<?> targetedType, NativeTypeInfo.Constructor... constructors) Creates an instance holding information relative to a specific native type that should be exposed to ZenCode.The created instance will not expose any native methods.
- Parameters:
name- The fully qualified name of the class as exposed to ZenCode. It does not have to match the actual name.targetedType- The native class this native type information is for.constructors-NativeTypeInfo.Constructors that ZenCode should know about, allowing them to be used in scripts.- Since:
- 9.1.0
-
NativeTypeInfo
public NativeTypeInfo(String name, Class<?> targetedType, NativeTypeInfo.Constructor[] constructors, NativeTypeInfo.Method... methods) Creates an instance of aNativeTypeInforecord class.- Parameters:
name- the value for thenamerecord componenttargetedType- the value for thetargetedTyperecord componentconstructors- the value for theconstructorsrecord componentmethods- the value for themethodsrecord 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
-
targetedType
Returns the value of thetargetedTyperecord component.- Returns:
- the value of the
targetedTyperecord component
-
constructors
Returns the value of theconstructorsrecord component.- Returns:
- the value of the
constructorsrecord component
-
methods
Returns the value of themethodsrecord component.- Returns:
- the value of the
methodsrecord component
-