Package com.io7m.jnoisetype.api
Class NTTransform
- java.lang.Object
-
- com.io7m.jnoisetype.api.NTTransform
-
- All Implemented Interfaces:
NTTransformType
public final class NTTransform extends java.lang.Object implements NTTransformType
- See Also:
- "SoundFontⓡ Technical Specification 2.04, §8.3 Modulator Transform Enumerators"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNTTransform.BuilderBuilds instances of typeNTTransform.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NTTransform.Builderbuilder()Creates a builder forNTTransform.static NTTransformcopyOf(NTTransformType instance)Creates an immutable copy of aNTTransformTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofNTTransformthat have equal attribute values.inthashCode()Computes a hash code from attributes:index,name.NTTransformIndexindex()java.lang.Stringname()static NTTransformof(NTTransformIndex index, java.lang.String name)Construct a new immutableNTTransforminstance.java.lang.StringtoString()Prints the immutable valueNTTransformwith attribute values.NTTransformwithIndex(NTTransformIndex value)Copy the current immutable object by setting a value for theindexattribute.NTTransformwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.
-
-
-
Method Detail
-
index
public NTTransformIndex index()
- Specified by:
indexin interfaceNTTransformType- Returns:
- The transform index
-
name
public java.lang.String name()
- Specified by:
namein interfaceNTTransformType- Returns:
- The transform name
-
withIndex
public final NTTransform withIndex(NTTransformIndex value)
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
public final NTTransform withName(java.lang.String value)
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 ofNTTransformthat 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 valueNTTransformwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static NTTransform of(NTTransformIndex index, java.lang.String name)
Construct a new immutableNTTransforminstance.- Parameters:
index- The value for theindexattributename- The value for thenameattribute- Returns:
- An immutable NTTransform instance
-
copyOf
public static NTTransform copyOf(NTTransformType instance)
Creates an immutable copy of aNTTransformTypevalue. 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 forNTTransform.NTTransform.builder() .setIndex(com.io7m.jnoisetype.api.NTTransformIndex) // requiredindex.setName(String) // requiredname.build();- Returns:
- A new NTTransform builder
-
-