public final class DataViewUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<SerializablePredicate<T>> |
getComponentFilter(Component component)
Gets the in-memory filter of a given component instance.
|
static <T> Optional<SerializableComparator<T>> |
getComponentSortComparator(Component component)
Gets the in-memory sort comparator of a given component instance.
|
static Query |
getQuery(Component component)
Generates a data query with component's in-memory filter and sort
comparator.
|
static Query |
getQuery(Component component,
boolean withSorting)
Generates a data query with component's in-memory filter and sort
comparator, which is optionally included if
withSorting is set to
true. |
static void |
removeComponentFilterAndSortComparator(Component component)
Removes the in-memory filter and sort comparator from a given component
instance.
|
static <T> void |
setComponentFilter(Component component,
SerializablePredicate<T> filter)
Sets the in-memory filter to a given component instance.
|
static <T> void |
setComponentSortComparator(Component component,
SerializableComparator<T> sortComparator)
Sets the in-memory sort comparator to a given component instance.
|
public static <T> Optional<SerializablePredicate<T>> getComponentFilter(Component component)
T - item typecomponent - component instance the filter is bound topublic static <T> Optional<SerializableComparator<T>> getComponentSortComparator(Component component)
T - item typecomponent - component instance the sort comparator is bound topublic static <T> void setComponentFilter(Component component, SerializablePredicate<T> filter)
null
will clear all filters.T - items typecomponent - component instance the filter is bound tofilter - component's in-memory filter to be set, or null
to clear any previously set filterspublic static <T> void setComponentSortComparator(Component component, SerializableComparator<T> sortComparator)
null will clear all sort comparators.T - items typecomponent - component instance the sort comparator is bound tosortComparator - component's in-memory sort comparator to be set, or
null to clear any previously set sort comparatorspublic static void removeComponentFilterAndSortComparator(Component component)
component - component instance the filter and sort comparator are removed
frompublic static Query getQuery(Component component)
component - component instance the filter and sort comparator are bound topublic static Query getQuery(Component component, boolean withSorting)
withSorting is set to
true.component - component instance the filter and sort comparator are bound towithSorting - if true, the component's sort comparator will be
included in the query.Copyright © 2021. All rights reserved.