Class NTTransform

java.lang.Object
com.io7m.jnoisetype.api.NTTransform
All Implemented Interfaces:
NTTransformType

public final class NTTransform extends Object implements NTTransformType
See Also:
  • "SoundFontⓡ Technical Specification 2.04, §8.3 Modulator Transform Enumerators"
  • Method Details

    • index

      public NTTransformIndex index()
      Specified by:
      index in interface NTTransformType
      Returns:
      The transform index
    • name

      public String name()
      Specified by:
      name in interface NTTransformType
      Returns:
      The transform name
    • withIndex

      public final NTTransform withIndex(NTTransformIndex value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy of the this object
    • withName

      public final NTTransform withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of NTTransform that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: index, name.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value NTTransform with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static NTTransform of(NTTransformIndex index, String name)
      Construct a new immutable NTTransform instance.
      Parameters:
      index - The value for the index attribute
      name - The value for the name attribute
      Returns:
      An immutable NTTransform instance
    • copyOf

      public static NTTransform copyOf(NTTransformType instance)
      Creates an immutable copy of a NTTransformType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable NTTransform instance
    • builder

      public static NTTransform.Builder builder()
      Creates a builder for NTTransform.
       NTTransform.builder()
          .setIndex(com.io7m.jnoisetype.api.NTTransformIndex) // required index
          .setName(String) // required name
          .build();
       
      Returns:
      A new NTTransform builder