Package com.io7m.jnoisetype.api
Class NTGenerator
java.lang.Object
com.io7m.jnoisetype.api.NTGenerator
- All Implemented Interfaces:
NTGeneratorType
- See Also:
-
- "SoundFontⓡ Technical Specification 2.04, §8.1 Generator Enumerators Defined"
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NTGenerator.Builder
builder()
Creates a builder forNTGenerator
.static NTGenerator
copyOf
(NTGeneratorType instance) Creates an immutable copy of aNTGeneratorType
value.boolean
This instance is equal to all instances ofNTGenerator
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:index
,name
.index()
name()
static NTGenerator
of
(NTGeneratorOperatorIndex index, String name) Construct a new immutableNTGenerator
instance.toString()
Prints the immutable valueNTGenerator
with attribute values.final NTGenerator
Copy the current immutable object by setting a value for theindex
attribute.final NTGenerator
Copy the current immutable object by setting a value for thename
attribute.
-
Method Details
-
index
- Specified by:
index
in interfaceNTGeneratorType
- Returns:
- The generator index
-
name
- Specified by:
name
in interfaceNTGeneratorType
- Returns:
- The generator name
-
withIndex
Copy the current immutable object by setting a value for theindex
attribute. 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
this
object
-
withName
Copy the current immutable object by setting a value for thename
attribute. 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
this
object
-
equals
This instance is equal to all instances ofNTGenerator
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:index
,name
. -
toString
Prints the immutable valueNTGenerator
with attribute values. -
of
Construct a new immutableNTGenerator
instance.- Parameters:
index
- The value for theindex
attributename
- The value for thename
attribute- Returns:
- An immutable NTGenerator instance
-
copyOf
Creates an immutable copy of aNTGeneratorType
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
Creates a builder forNTGenerator
.NTGenerator.builder() .setIndex(com.io7m.jnoisetype.api.NTGeneratorOperatorIndex) // required
index
.setName(String) // requiredname
.build();- Returns:
- A new NTGenerator builder
-