Class WebHistoryBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.web.WebHistoryBuilder
The
WebHistoryBuilder
class constructs instances of the WebHistory
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 WebHistory
constructor
and returns an instance of the WebHistoryBuilder
.
You can use method chaining to call the builder methods for configuring the WebHistory
.
Finally, invoke the build
method to generate an instance of the WebHistory
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 TypeMethodDescriptionfinal WebHistoryBuilder
addEntries
(Collection<? extends WebHistory.Entry> col) Calls theaddAll
method on the ObservableList returned by theWebHistory#getEntries()
method.final WebHistoryBuilder
addEntries
(WebHistory.Entry... elements) Calls theaddAll
method on the ObservableList returned by theWebHistory#getEntries()
method.apply
(Consumer<WebHistory> func) Applies a function to the WebHistory instance being constructed.build()
Builds and returns an instance of theWebHistory
class.Applies a function to thecurrentIndexProperty
of the instance being constructed.maxSize
(int value) A builder method that invokes thesetMaxSize
method on the instance being constructed.Applies a function to themaxSizeProperty
of the instance being constructed.
-
Method Details
-
build
Builds and returns an instance of theWebHistory
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
WebHistory
class
-
apply
Applies a function to the WebHistory instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
maxSize
A builder method that invokes thesetMaxSize
method on the instance being constructed.- Returns:
- builder instance
-
addEntries
Calls theaddAll
method on the ObservableList returned by theWebHistory#getEntries()
method.- Returns:
- builder instance
-
addEntries
Calls theaddAll
method on the ObservableList returned by theWebHistory#getEntries()
method.- Returns:
- builder instance
-
currentIndexPropertyApply
Applies a function to thecurrentIndexProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.currentIndexProperty().bind(anotherProperty)) // Use shorthand form .currentIndexPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
maxSizePropertyApply
Applies a function to themaxSizeProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.maxSizeProperty().bind(anotherProperty)) // Use shorthand form .maxSizePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-