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 thesetBalancemethod on the instance being constructed.Applies a function to thebalancePropertyof the instance being constructed.build()Builds and returns an instance of theAudioClipclass.static AudioClipBuilderAccepts the constructor arguments ofAudioClip(String)and returns an instance ofAudioClipBuilder.cycleCount(int count) A builder method that invokes thesetCycleCountmethod on the instance being constructed.Applies a function to thecycleCountPropertyof the instance being constructed.pan(double pan) A builder method that invokes thesetPanmethod on the instance being constructed.Applies a function to thepanPropertyof the instance being constructed.priority(int priority) A builder method that invokes thesetPrioritymethod on the instance being constructed.Applies a function to thepriorityPropertyof the instance being constructed.rate(double rate) A builder method that invokes thesetRatemethod on the instance being constructed.Applies a function to theratePropertyof the instance being constructed.volume(double value) A builder method that invokes thesetVolumemethod on the instance being constructed.Applies a function to thevolumePropertyof 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
-
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 thesetBalancemethod on the instance being constructed.- Returns:
- builder instance
-
cycleCount
A builder method that invokes thesetCycleCountmethod on the instance being constructed.- Returns:
- builder instance
-
pan
A builder method that invokes thesetPanmethod on the instance being constructed.- Returns:
- builder instance
-
priority
A builder method that invokes thesetPrioritymethod on the instance being constructed.- Returns:
- builder instance
-
rate
A builder method that invokes thesetRatemethod on the instance being constructed.- Returns:
- builder instance
-
volume
A builder method that invokes thesetVolumemethod on the instance being constructed.- Returns:
- builder instance
-
balancePropertyApply
Applies a function to thebalancePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thecycleCountPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thepanPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thepriorityPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theratePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thevolumePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.volumeProperty().bind(anotherProperty)) // Use shorthand form .volumePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-