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 providedNTSampleDescriptionType
instance.setEnd
(long end) Initializes the value for theend
attribute.setKind
(NTSampleKind kind) Initializes the value for thekind
attribute.setLoopEnd
(long loopEnd) Initializes the value for theloopEnd
attribute.setLoopStart
(long loopStart) Initializes the value for theloopStart
attribute.setName
(NTSampleName name) Initializes the value for thename
attribute.setOriginalPitch
(NTPitch originalPitch) Initializes the value for theoriginalPitch
attribute.setPitchCorrection
(int pitchCorrection) Initializes the value for thepitchCorrection
attribute.setSampleLink
(int sampleLink) Initializes the value for thesampleLink
attribute.setSampleRate
(int sampleRate) Initializes the value for thesampleRate
attribute.setStart
(long start) Initializes the value for thestart
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedNTSampleDescriptionType
instance. 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:
this
builder for use in a chained invocation
-
setName
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
setKind
Initializes the value for thekind
attribute.- Parameters:
kind
- The value for kind- Returns:
this
builder for use in a chained invocation
-
setStart
Initializes the value for thestart
attribute.- Parameters:
start
- The value for start- Returns:
this
builder for use in a chained invocation
-
setEnd
Initializes the value for theend
attribute.- Parameters:
end
- The value for end- Returns:
this
builder for use in a chained invocation
-
setLoopStart
Initializes the value for theloopStart
attribute.- Parameters:
loopStart
- The value for loopStart- Returns:
this
builder for use in a chained invocation
-
setLoopEnd
Initializes the value for theloopEnd
attribute.- Parameters:
loopEnd
- The value for loopEnd- Returns:
this
builder for use in a chained invocation
-
setSampleRate
Initializes the value for thesampleRate
attribute.- Parameters:
sampleRate
- The value for sampleRate- Returns:
this
builder for use in a chained invocation
-
setOriginalPitch
Initializes the value for theoriginalPitch
attribute.- Parameters:
originalPitch
- The value for originalPitch- Returns:
this
builder for use in a chained invocation
-
setPitchCorrection
Initializes the value for thepitchCorrection
attribute.- Parameters:
pitchCorrection
- The value for pitchCorrection- Returns:
this
builder for use in a chained invocation
-
setSampleLink
Initializes the value for thesampleLink
attribute.If not set, this attribute will have a default value as returned by the initializer of
sampleLink
.- Parameters:
sampleLink
- The value for sampleLink- Returns:
this
builder for use in a chained invocation
-
build
Builds a newNTSampleDescription
.- Returns:
- An immutable instance of NTSampleDescription
- Throws:
IllegalStateException
- if any required attributes are missing
-