Class SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder
The
SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder class constructs instances of the DoubleSpinnerValueFactory 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 DoubleSpinnerValueFactory constructor
and returns an instance of the SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.
You can use method chaining to call the builder methods for configuring the DoubleSpinnerValueFactory.
Finally, invoke the build method to generate an instance of the DoubleSpinnerValueFactory 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 TypeMethodDescriptionamountToStepBy(double value) A builder method that invokes thesetAmountToStepBymethod on the instance being constructed.Applies a function to theamountToStepByPropertyof the instance being constructed.Applies a function to the DoubleSpinnerValueFactory instance being constructed.build()Builds and returns an instance of theDoubleSpinnerValueFactoryclass.converter(StringConverter<Double> newValue) A builder method that invokes thesetConvertermethod on the instance being constructed.Applies a function to theconverterPropertyof the instance being constructed.create(double min, double max) Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.create(double min, double max, double initialValue) Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.create(double min, double max, double initialValue, double amountToStepBy) Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double, double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.max(double value) A builder method that invokes thesetMaxmethod on the instance being constructed.Applies a function to themaxPropertyof the instance being constructed.min(double value) A builder method that invokes thesetMinmethod on the instance being constructed.Applies a function to theminPropertyof the instance being constructed.A builder method that invokes thesetValuemethod on the instance being constructed.Applies a function to thevaluePropertyof the instance being constructed.wrapAround(boolean value) A builder method that invokes thesetWrapAroundmethod on the instance being constructed.Applies a function to thewrapAroundPropertyof the instance being constructed.
-
Method Details
-
create
Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.- Returns:
- an instance of the
SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.
-
create
public static SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder create(double min, double max, double initialValue) Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.- Returns:
- an instance of the
SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.
-
create
public static SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder create(double min, double max, double initialValue, double amountToStepBy) Accepts the constructor arguments ofDoubleSpinnerValueFactory(double, double, double, double)and returns an instance ofSpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.- Returns:
- an instance of the
SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder.
-
build
Builds and returns an instance of theDoubleSpinnerValueFactoryclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
DoubleSpinnerValueFactoryclass
-
apply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder apply(Consumer<SpinnerValueFactory.DoubleSpinnerValueFactory> func) Applies a function to the DoubleSpinnerValueFactory instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
amountToStepBy
A builder method that invokes thesetAmountToStepBymethod on the instance being constructed.- Returns:
- builder instance
-
converter
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder converter(StringConverter<Double> newValue) A builder method that invokes thesetConvertermethod on the instance being constructed.- Returns:
- builder instance
-
max
A builder method that invokes thesetMaxmethod on the instance being constructed.- Returns:
- builder instance
-
min
A builder method that invokes thesetMinmethod on the instance being constructed.- Returns:
- builder instance
-
value
A builder method that invokes thesetValuemethod on the instance being constructed.- Returns:
- builder instance
-
wrapAround
A builder method that invokes thesetWrapAroundmethod on the instance being constructed.- Returns:
- builder instance
-
amountToStepByPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder amountToStepByPropertyApply(Consumer<DoubleProperty> op) Applies a function to theamountToStepByPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.amountToStepByProperty().bind(anotherProperty)) // Use shorthand form .amountToStepByPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
converterPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder converterPropertyApply(Consumer<ObjectProperty<StringConverter<Double>>> op) Applies a function to theconverterPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.converterProperty().bind(anotherProperty)) // Use shorthand form .converterPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
maxPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder maxPropertyApply(Consumer<DoubleProperty> op) Applies a function to themaxPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.maxProperty().bind(anotherProperty)) // Use shorthand form .maxPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
minPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder minPropertyApply(Consumer<DoubleProperty> op) Applies a function to theminPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.minProperty().bind(anotherProperty)) // Use shorthand form .minPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
valuePropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder valuePropertyApply(Consumer<ObjectProperty<Double>> op) Applies a function to thevaluePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.valueProperty().bind(anotherProperty)) // Use shorthand form .valuePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
wrapAroundPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder wrapAroundPropertyApply(Consumer<BooleanProperty> op) Applies a function to thewrapAroundPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.wrapAroundProperty().bind(anotherProperty)) // Use shorthand form .wrapAroundPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-