Class AudioClipBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.media.AudioClipBuilder
The
AudioClipBuilder
class constructs instances of the AudioClip
class
and offers a fluent interface for creating and configuring it.
This class includes a static create
method that accepts the same arguments as the original AudioClip
constructor
and returns an instance of the AudioClipBuilder
.
You can use method chaining to call the builder methods for configuring the AudioClip
.
Finally, invoke the build
method to generate an instance of the AudioClip
class.
Note that intermediate builder methods are not evaluated until the build
method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionApplies a function to the AudioClip instance being constructed.balance
(double balance) A builder method that invokes thesetBalance
method on the instance being constructed.Applies a function to thebalanceProperty
of the instance being constructed.build()
Builds and returns an instance of theAudioClip
class.static AudioClipBuilder
Accepts the constructor arguments ofAudioClip(String)
and returns an instance ofAudioClipBuilder
.cycleCount
(int count) A builder method that invokes thesetCycleCount
method on the instance being constructed.Applies a function to thecycleCountProperty
of the instance being constructed.pan
(double pan) A builder method that invokes thesetPan
method on the instance being constructed.Applies a function to thepanProperty
of the instance being constructed.priority
(int priority) A builder method that invokes thesetPriority
method on the instance being constructed.Applies a function to thepriorityProperty
of the instance being constructed.rate
(double rate) A builder method that invokes thesetRate
method on the instance being constructed.Applies a function to therateProperty
of the instance being constructed.volume
(double value) A builder method that invokes thesetVolume
method on the instance being constructed.Applies a function to thevolumeProperty
of the instance being constructed.
-
Method Details
-
create
Accepts the constructor arguments ofAudioClip(String)
and returns an instance ofAudioClipBuilder
.- Returns:
- an instance of the
AudioClipBuilder
.
-
build
Builds and returns an instance of theAudioClip
class.Intermediate builder methods are not evaluated until the
build
method is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
AudioClip
class
-
apply
Applies a function to the AudioClip instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
balance
A builder method that invokes thesetBalance
method on the instance being constructed.- Returns:
- builder instance
-
cycleCount
A builder method that invokes thesetCycleCount
method on the instance being constructed.- Returns:
- builder instance
-
pan
A builder method that invokes thesetPan
method on the instance being constructed.- Returns:
- builder instance
-
priority
A builder method that invokes thesetPriority
method on the instance being constructed.- Returns:
- builder instance
-
rate
A builder method that invokes thesetRate
method on the instance being constructed.- Returns:
- builder instance
-
volume
A builder method that invokes thesetVolume
method on the instance being constructed.- Returns:
- builder instance
-
balancePropertyApply
Applies a function to thebalanceProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.balanceProperty().bind(anotherProperty)) // Use shorthand form .balancePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
cycleCountPropertyApply
Applies a function to thecycleCountProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.cycleCountProperty().bind(anotherProperty)) // Use shorthand form .cycleCountPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
panPropertyApply
Applies a function to thepanProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.panProperty().bind(anotherProperty)) // Use shorthand form .panPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
priorityPropertyApply
Applies a function to thepriorityProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.priorityProperty().bind(anotherProperty)) // Use shorthand form .priorityPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
ratePropertyApply
Applies a function to therateProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.rateProperty().bind(anotherProperty)) // Use shorthand form .ratePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
volumePropertyApply
Applies a function to thevolumeProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.volumeProperty().bind(anotherProperty)) // Use shorthand form .volumePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-