Record Class NativeTypeInfo.Parameter

java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.natives.NativeTypeInfo.Parameter
Record Components:
type - The type of the parameter that should be exposed.
name - The name of the parameter that is being targeted.
description - The description of the parameter, acting as documentation.
examples - A series of strings that can be used to provide examples of valid arguments for this parameter, acting as documentation; or an empty array if no examples are to be provided.
Enclosing class:
NativeTypeInfo

public static record NativeTypeInfo.Parameter(Class<?> type, String name, String description, String[] examples) extends Record
Holds information relative to a specific parameter of a native method or native constructor that is exposed to ZenCode.
Since:
9.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Parameter(Class<?> type, String name)
    Constructs an instance holding information relative to a parameter of a method or constructor that is exposed to ZenCode.
    Parameter(Class<?> type, String name, String... examples)
    Constructs an instance holding information relative to a parameter of a method or constructor that is exposed to ZenCode.
    Parameter(Class<?> type, String name, String description, String... examples)
    Creates an instance of a Parameter record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the description record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the examples record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Parameter

      public Parameter(Class<?> type, String name, String... examples)
      Constructs an instance holding information relative to a parameter of a method or constructor that is exposed to ZenCode.

      The created parameter has no description.

      Parameters:
      type - The type of the parameter that should be exposed.
      name - The name of the parameter that is being targeted.
      examples - A series of strings that can be used to provide examples of valid arguments for this parameter, acting as documentation; or an empty array if no examples are to be provided.
      Since:
      9.1.0
    • Parameter

      public Parameter(Class<?> type, String name)
      Constructs an instance holding information relative to a parameter of a method or constructor that is exposed to ZenCode.

      The created parameter has no description and no examples.

      Parameters:
      type - The type of the parameter that should be exposed.
      name - The name of the parameter that is being targeted.
      Since:
      9.1.0
    • Parameter

      public Parameter(Class<?> type, String name, String description, String... examples)
      Creates an instance of a Parameter record class.
      Parameters:
      type - the value for the type record component
      name - the value for the name record component
      description - the value for the description record component
      examples - the value for the examples record component
  • Method Details

    • 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.
    • type

      public Class<?> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • examples

      public String[] examples()
      Returns the value of the examples record component.
      Returns:
      the value of the examples record component