Package com.io7m.jnoisetype.api
Class NTSampleDescription.Builder
java.lang.Object
com.io7m.jnoisetype.api.NTSampleDescription.Builder
- Enclosing class:
- NTSampleDescription
public static final class NTSampleDescription.Builder
extends java.lang.Object
Builds instances of type
NTSampleDescription.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and Type Method Description NTSampleDescriptionbuild()Builds a newNTSampleDescription.NTSampleDescription.Builderfrom(NTSampleDescriptionType instance)Fill a builder with attribute values from the providedNTSampleDescriptionTypeinstance.NTSampleDescription.BuildersetEnd(long end)Initializes the value for theendattribute.NTSampleDescription.BuildersetKind(NTSampleKind kind)Initializes the value for thekindattribute.NTSampleDescription.BuildersetLoopEnd(long loopEnd)Initializes the value for theloopEndattribute.NTSampleDescription.BuildersetLoopStart(long loopStart)Initializes the value for theloopStartattribute.NTSampleDescription.BuildersetName(NTSampleName name)Initializes the value for thenameattribute.NTSampleDescription.BuildersetOriginalPitch(NTPitch originalPitch)Initializes the value for theoriginalPitchattribute.NTSampleDescription.BuildersetPitchCorrection(int pitchCorrection)Initializes the value for thepitchCorrectionattribute.NTSampleDescription.BuildersetSampleLink(int sampleLink)Initializes the value for thesampleLinkattribute.NTSampleDescription.BuildersetSampleRate(int sampleRate)Initializes the value for thesampleRateattribute.NTSampleDescription.BuildersetStart(long start)Initializes the value for thestartattribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
from
Fill a builder with attribute values from the providedNTSampleDescriptionTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setName
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
setKind
Initializes the value for thekindattribute.- Parameters:
kind- The value for kind- Returns:
thisbuilder for use in a chained invocation
-
setStart
Initializes the value for thestartattribute.- Parameters:
start- The value for start- Returns:
thisbuilder for use in a chained invocation
-
setEnd
Initializes the value for theendattribute.- Parameters:
end- The value for end- Returns:
thisbuilder for use in a chained invocation
-
setLoopStart
Initializes the value for theloopStartattribute.- Parameters:
loopStart- The value for loopStart- Returns:
thisbuilder for use in a chained invocation
-
setLoopEnd
Initializes the value for theloopEndattribute.- Parameters:
loopEnd- The value for loopEnd- Returns:
thisbuilder for use in a chained invocation
-
setSampleRate
Initializes the value for thesampleRateattribute.- Parameters:
sampleRate- The value for sampleRate- Returns:
thisbuilder for use in a chained invocation
-
setOriginalPitch
Initializes the value for theoriginalPitchattribute.- Parameters:
originalPitch- The value for originalPitch- Returns:
thisbuilder for use in a chained invocation
-
setPitchCorrection
Initializes the value for thepitchCorrectionattribute.- Parameters:
pitchCorrection- The value for pitchCorrection- Returns:
thisbuilder for use in a chained invocation
-
setSampleLink
Initializes the value for thesampleLinkattribute.If not set, this attribute will have a default value as returned by the initializer of
sampleLink.- Parameters:
sampleLink- The value for sampleLink- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNTSampleDescription.- Returns:
- An immutable instance of NTSampleDescription
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-