Package com.io7m.jnoisetype.api
Class NTSampleDescription.Builder
java.lang.Object
com.io7m.jnoisetype.api.NTSampleDescription.Builder
- Enclosing class:
- NTSampleDescription
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 TypeMethodDescriptionbuild()Builds a newNTSampleDescription.from(NTSampleDescriptionType instance) Fill a builder with attribute values from the providedNTSampleDescriptionTypeinstance.setEnd(long end) Initializes the value for theendattribute.setKind(NTSampleKind kind) Initializes the value for thekindattribute.setLoopEnd(long loopEnd) Initializes the value for theloopEndattribute.setLoopStart(long loopStart) Initializes the value for theloopStartattribute.setName(NTSampleName name) Initializes the value for thenameattribute.setOriginalPitch(NTPitch originalPitch) Initializes the value for theoriginalPitchattribute.setPitchCorrection(int pitchCorrection) Initializes the value for thepitchCorrectionattribute.setSampleLink(int sampleLink) Initializes the value for thesampleLinkattribute.setSampleRate(int sampleRate) Initializes the value for thesampleRateattribute.setStart(long start) Initializes the value for thestartattribute.
-
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:
IllegalStateException- if any required attributes are missing
-