public final class PaginationStateBuilder<Context extends IFContext,Builder extends ItemComponentBuilder<Builder,Context> & ComponentFactory,V>
extends java.lang.Object
| Constructor and Description |
|---|
PaginationStateBuilder(ElementFactory internalElementFactory,
java.lang.Object sourceProvider,
java.util.function.Function<PaginationStateBuilder<Context,Builder,V>,State<Pagination>> internalStateFactory,
boolean async,
boolean computed) |
| Modifier and Type | Method and Description |
|---|---|
State<Pagination> |
build()
Builds a pagination state based on this builder values.
|
PaginationStateBuilder<Context,Builder,V> |
elementFactory(@NotNull PaginationValueConsumer<Context,Builder,V> elementConsumer)
Sets the item factory for pagination.
|
char |
getLayoutTarget() |
java.util.function.BiConsumer<Context,Pagination> |
getPageSwitchHandler() |
PaginationElementFactory<V> |
getPaginationElementFactory() |
java.lang.Object |
getSourceProvider() |
boolean |
isAsync() |
boolean |
isComputed() |
PaginationStateBuilder<Context,Builder,V> |
itemFactory(@NotNull java.util.function.BiConsumer<Builder,V> itemFactory)
Sets the item factory for pagination.
|
PaginationStateBuilder<Context,Builder,V> |
layoutTarget(char layoutTarget)
Defines a target character in the layout whose pagination will be rendered.
|
PaginationStateBuilder<Context,Builder,V> |
onPageSwitch(@NotNull java.util.function.BiConsumer<Context,Pagination> pageSwitchHandler)
Handles the page switching action.
|
public PaginationStateBuilder(ElementFactory internalElementFactory, java.lang.Object sourceProvider, java.util.function.Function<PaginationStateBuilder<Context,Builder,V>,State<Pagination>> internalStateFactory, boolean async, boolean computed)
public PaginationStateBuilder<Context,Builder,V> itemFactory(@NotNull @NotNull java.util.function.BiConsumer<Builder,V> itemFactory)
It consists of a function whose first parameter is a derivation of the
ItemComponentBuilder that must be used to configure the item, and the second
parameter is the current element being paginated.
This function is called for every single paginated element.
itemFactory - The item factory.public PaginationStateBuilder<Context,Builder,V> elementFactory(@NotNull @NotNull PaginationValueConsumer<Context,Builder,V> elementConsumer)
It consists of a function whose first parameter is a derivation of the
ItemComponentBuilder that must be used to configure the item, and the second
parameter is the current element being paginated.
This function is called for every single paginated element.
elementConsumer - The element consumer.public PaginationStateBuilder<Context,Builder,V> layoutTarget(char layoutTarget)
By default, if there is a layout available and a target character has not
been explicitly defined in the layout, the layout's rendering target
character will be the reserved layout character.
If there is no layout configured, pagination will be rendered throughout the view container.
layoutTarget - The target layout character.public PaginationStateBuilder<Context,Builder,V> onPageSwitch(@NotNull @NotNull java.util.function.BiConsumer<Context,Pagination> pageSwitchHandler)
The first parameter is the previous page and the current page can be
obtained through Pagination.currentPage().
pageSwitchHandler - The page switch handler.public State<Pagination> build()
Pagination state.java.lang.IllegalStateException - If the element factory wasn't set.public char getLayoutTarget()
public java.lang.Object getSourceProvider()
public boolean isAsync()
public boolean isComputed()
public java.util.function.BiConsumer<Context,Pagination> getPageSwitchHandler()
public PaginationElementFactory<V> getPaginationElementFactory()