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 WebHistoryBuilderaddEntries(Collection<? extends WebHistory.Entry> col) Calls theaddAllmethod on the ObservableList returned by theWebHistory#getEntries()method.final WebHistoryBuilderaddEntries(WebHistory.Entry... elements) Calls theaddAllmethod 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 theWebHistoryclass.Applies a function to thecurrentIndexPropertyof the instance being constructed.maxSize(int value) A builder method that invokes thesetMaxSizemethod on the instance being constructed.Applies a function to themaxSizePropertyof the instance being constructed.
-
Method Details
-
build
Builds and returns an instance of theWebHistoryclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
WebHistoryclass
-
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 thesetMaxSizemethod on the instance being constructed.- Returns:
- builder instance
-
addEntries
Calls theaddAllmethod on the ObservableList returned by theWebHistory#getEntries()method.- Returns:
- builder instance
-
addEntries
Calls theaddAllmethod on the ObservableList returned by theWebHistory#getEntries()method.- Returns:
- builder instance
-
currentIndexPropertyApply
Applies a function to thecurrentIndexPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 themaxSizePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.maxSizeProperty().bind(anotherProperty)) // Use shorthand form .maxSizePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-