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 thesetAmountToStepBymethod on the instance being constructed.Applies a function to theamountToStepByPropertyof the instance being constructed.Applies a function to the IntegerSpinnerValueFactory instance being constructed.build()Builds and returns an instance of theIntegerSpinnerValueFactoryclass.converter(StringConverter<Integer> newValue) A builder method that invokes thesetConvertermethod on the instance being constructed.Applies a function to theconverterPropertyof 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 thesetMaxmethod on the instance being constructed.Applies a function to themaxPropertyof the instance being constructed.min(int 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 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 theIntegerSpinnerValueFactoryclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
IntegerSpinnerValueFactoryclass
-
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 thesetAmountToStepBymethod on the instance being constructed.- Returns:
- builder instance
-
converter
public SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder converter(StringConverter<Integer> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder amountToStepByPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder converterPropertyApply(Consumer<ObjectProperty<StringConverter<Integer>>> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder maxPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder minPropertyApply(Consumer<IntegerProperty> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder valuePropertyApply(Consumer<ObjectProperty<Integer>> 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 SpinnerValueFactoryIntegerSpinnerValueFactoryBuilder 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
-