Class TreeItemTreeModificationEventBuilder<T>
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.TreeItemTreeModificationEventBuilder<T>
The
TreeItemTreeModificationEventBuilder
class constructs instances of the TreeModificationEvent
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 TreeModificationEvent
constructor
and returns an instance of the TreeItemTreeModificationEventBuilder
.
You can use method chaining to call the builder methods for configuring the TreeModificationEvent
.
Finally, invoke the build
method to generate an instance of the TreeModificationEvent
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 TypeMethodDescriptionapply
(Consumer<TreeItem.TreeModificationEvent<T>> func) Applies a function to the TreeModificationEvent instance being constructed.build()
Builds and returns an instance of theTreeModificationEvent
class.static <T> TreeItemTreeModificationEventBuilder<T>
Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.static <T> TreeItemTreeModificationEventBuilder<T>
Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, boolean)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.static <T> TreeItemTreeModificationEventBuilder<T>
create
(EventType<? extends Event> eventType, TreeItem<T> treeItem, List<? extends TreeItem<T>> added, List<? extends TreeItem<T>> removed) Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, List, List)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.static <T> TreeItemTreeModificationEventBuilder<T>
Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, T)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.
-
Method Details
-
create
public static <T> TreeItemTreeModificationEventBuilder<T> create(EventType<? extends Event> eventType, TreeItem<T> treeItem) Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.- Returns:
- an instance of the
TreeItemTreeModificationEventBuilder<T>
.
-
create
public static <T> TreeItemTreeModificationEventBuilder<T> create(EventType<? extends Event> eventType, TreeItem<T> treeItem, T newValue) Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, T)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.- Returns:
- an instance of the
TreeItemTreeModificationEventBuilder<T>
.
-
create
public static <T> TreeItemTreeModificationEventBuilder<T> create(EventType<? extends Event> eventType, TreeItem<T> treeItem, boolean expanded) Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, boolean)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.- Returns:
- an instance of the
TreeItemTreeModificationEventBuilder<T>
.
-
create
public static <T> TreeItemTreeModificationEventBuilder<T> create(EventType<? extends Event> eventType, TreeItem<T> treeItem, List<? extends TreeItem<T>> added, List<? extends TreeItem<T>> removed) Accepts the constructor arguments ofTreeModificationEvent(EventType, TreeItem, List, List)
and returns an instance ofTreeItemTreeModificationEventBuilder<T>
.- Returns:
- an instance of the
TreeItemTreeModificationEventBuilder<T>
.
-
build
Builds and returns an instance of theTreeModificationEvent
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
TreeModificationEvent
class
-
apply
public TreeItemTreeModificationEventBuilder<T> apply(Consumer<TreeItem.TreeModificationEvent<T>> func) Applies a function to the TreeModificationEvent instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-