Class SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
The
SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
class constructs instances of the IntegerSpinnerValueFactory
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 IntegerSpinnerValueFactory
constructor
and returns an instance of the SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.
You can use method chaining to call the builder methods for configuring the IntegerSpinnerValueFactory
.
Finally, invoke the build
method to generate an instance of the IntegerSpinnerValueFactory
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
(int 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 IntegerSpinnerValueFactory instance being constructed.build()
Builds and returns an instance of theIntegerSpinnerValueFactory
class.converter
(StringConverter<Integer> newValue) A builder method that invokes thesetConverter
method on the instance being constructed.Applies a function to theconverterProperty
of the instance being constructed.create
(int min, int max) Accepts the constructor arguments ofIntegerSpinnerValueFactory(int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.create
(int min, int max, int initialValue) Accepts the constructor arguments ofIntegerSpinnerValueFactory(int, int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.create
(int min, int max, int initialValue, int amountToStepBy) Accepts the constructor arguments ofIntegerSpinnerValueFactory(int, int, int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.max
(int value) A builder method that invokes thesetMax
method on the instance being constructed.Applies a function to themaxProperty
of the instance being constructed.min
(int 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 ofIntegerSpinnerValueFactory(int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.- Returns:
- an instance of the
SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.
-
create
public static SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder create(int min, int max, int initialValue) Accepts the constructor arguments ofIntegerSpinnerValueFactory(int, int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.- Returns:
- an instance of the
SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.
-
create
public static SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder create(int min, int max, int initialValue, int amountToStepBy) Accepts the constructor arguments ofIntegerSpinnerValueFactory(int, int, int, int)
and returns an instance ofSpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.- Returns:
- an instance of the
SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder
.
-
build
Builds and returns an instance of theIntegerSpinnerValueFactory
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
IntegerSpinnerValueFactory
class
-
apply
public SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder apply(Consumer<SpinnerValueFactory.IntegerSpinnerValueFactory> func) Applies a function to the IntegerSpinnerValueFactory 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder converter(StringConverter<Integer> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder amountToStepByPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder converterPropertyApply(Consumer<ObjectProperty<StringConverter<Integer>>> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder maxPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder minPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder valuePropertyApply(Consumer<ObjectProperty<Integer>> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder 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
-