Class NTGenerator

java.lang.Object
com.io7m.jnoisetype.api.NTGenerator
All Implemented Interfaces:
NTGeneratorType

public final class NTGenerator
extends java.lang.Object
implements NTGeneratorType
See Also:
"SoundFontⓡ Technical Specification 2.04, §8.1 Generator Enumerators Defined"
  • Method Details

    • index

      public NTGeneratorOperatorIndex index()
      Specified by:
      index in interface NTGeneratorType
      Returns:
      The generator index
    • name

      public java.lang.String name()
      Specified by:
      name in interface NTGeneratorType
      Returns:
      The generator name
    • withIndex

      public final NTGenerator withIndex​(NTGeneratorOperatorIndex 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 NTGenerator withName​(java.lang.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​(java.lang.Object another)
      This instance is equal to all instances of NTGenerator that have equal attribute values.
      Overrides:
      equals in class java.lang.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 java.lang.Object
      Returns:
      hashCode value
    • toString

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

      public static NTGenerator of​(NTGeneratorOperatorIndex index, java.lang.String name)
      Construct a new immutable NTGenerator instance.
      Parameters:
      index - The value for the index attribute
      name - The value for the name attribute
      Returns:
      An immutable NTGenerator instance
    • copyOf

      public static NTGenerator copyOf​(NTGeneratorType instance)
      Creates an immutable copy of a NTGeneratorType 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 NTGenerator instance
    • builder

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