Package com.io7m.jnoisetype.api
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"
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNTGenerator.BuilderBuilds instances of typeNTGenerator. -
Method Summary
Modifier and Type Method Description static NTGenerator.Builderbuilder()Creates a builder forNTGenerator.static NTGeneratorcopyOf(NTGeneratorType instance)Creates an immutable copy of aNTGeneratorTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofNTGeneratorthat have equal attribute values.inthashCode()Computes a hash code from attributes:index,name.NTGeneratorOperatorIndexindex()java.lang.Stringname()static NTGeneratorof(NTGeneratorOperatorIndex index, java.lang.String name)Construct a new immutableNTGeneratorinstance.java.lang.StringtoString()Prints the immutable valueNTGeneratorwith attribute values.NTGeneratorwithIndex(NTGeneratorOperatorIndex value)Copy the current immutable object by setting a value for theindexattribute.NTGeneratorwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
index
- Specified by:
indexin interfaceNTGeneratorType- Returns:
- The generator index
-
name
public java.lang.String name()- Specified by:
namein interfaceNTGeneratorType- Returns:
- The generator name
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofNTGeneratorthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:index,name.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueNTGeneratorwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableNTGeneratorinstance.- Parameters:
index- The value for theindexattributename- The value for thenameattribute- Returns:
- An immutable NTGenerator instance
-
copyOf
Creates an immutable copy of aNTGeneratorTypevalue. 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
Creates a builder forNTGenerator.NTGenerator.builder() .setIndex(com.io7m.jnoisetype.api.NTGeneratorOperatorIndex) // requiredindex.setName(String) // requiredname.build();- Returns:
- A new NTGenerator builder
-