Class SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder
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 thesetAmountToStepBy
method on the instance being constructed.Applies a function to theamountToStepByProperty
of the instance being constructed.Applies a function to the DoubleSpinnerValueFactory instance being constructed.build()
Builds and returns an instance of theDoubleSpinnerValueFactory
class.converter
(StringConverter<Double> newValue) A builder method that invokes thesetConverter
method on the instance being constructed.Applies a function to theconverterProperty
of 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 thesetMax
method on the instance being constructed.Applies a function to themaxProperty
of the instance being constructed.min
(double value) A builder method that invokes thesetMin
method on the instance being constructed.Applies a function to theminProperty
of the instance being constructed.A builder method that invokes thesetValue
method on the instance being constructed.Applies a function to thevalueProperty
of the instance being constructed.wrapAround
(boolean value) A builder method that invokes thesetWrapAround
method on the instance being constructed.Applies a function to thewrapAroundProperty
of 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 theDoubleSpinnerValueFactory
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
DoubleSpinnerValueFactory
class
-
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 thesetAmountToStepBy
method on the instance being constructed.- Returns:
- builder instance
-
converter
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder converter(StringConverter<Double> newValue) A builder method that invokes thesetConverter
method on the instance being constructed.- Returns:
- builder instance
-
max
A builder method that invokes thesetMax
method on the instance being constructed.- Returns:
- builder instance
-
min
A builder method that invokes thesetMin
method on the instance being constructed.- Returns:
- builder instance
-
value
A builder method that invokes thesetValue
method on the instance being constructed.- Returns:
- builder instance
-
wrapAround
A builder method that invokes thesetWrapAround
method on the instance being constructed.- Returns:
- builder instance
-
amountToStepByPropertyApply
public SpinnerValueFactoryDoubleSpinnerValueFactoryBuilder amountToStepByPropertyApply(Consumer<DoubleProperty> op) Applies a function to theamountToStepByProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 theconverterProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 themaxProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 theminProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thevalueProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thewrapAroundProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.wrapAroundProperty().bind(anotherProperty)) // Use shorthand form .wrapAroundPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-