Class PagingPredicate<K,V>
java.lang.Object
com.loomcache.server.query.PagingPredicate<K,V>
- All Implemented Interfaces:
MapPredicate<K,V>
Stateful map-entry predicate that returns one page of matching entries at a time.
This mirrors Hazelcast's PagingPredicate shape: the predicate carries mutable page state and is therefore not thread-safe. Callers should use one instance per iteration flow.
-
Constructor Summary
ConstructorsConstructorDescriptionPagingPredicate(MapPredicate<K, V> predicate, int pageSize) PagingPredicate(MapPredicate<K, V> predicate, Comparator<? super Map.Entry<K, V>> comparator, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionComparator<? super Map.Entry<K, V>> filterEntries(MapPredicate<K, V> predicate, Collection<Map.Entry<K, V>> entries) voidnextPage()intpage()page(Collection<Map.Entry<K, V>> entries) intpageSize()voidvoidreset()voidsetPage(int page) booleanTests whether the given map entry matches this predicate.toString()
-
Constructor Details
-
PagingPredicate
-
PagingPredicate
public PagingPredicate(MapPredicate<K, V> predicate, Comparator<? super Map.Entry<K, V>> comparator, int pageSize)
-
-
Method Details
-
predicate
-
comparator
-
pageSize
public int pageSize() -
page
public int page() -
nextPage
public void nextPage() -
previousPage
public void previousPage() -
reset
public void reset() -
setPage
public void setPage(int page) -
test
Description copied from interface:MapPredicateTests whether the given map entry matches this predicate.- Specified by:
testin interfaceMapPredicate<K,V> - Parameters:
key- the entry key (non-null)value- the entry value (non-null)- Returns:
trueif the entry matches,falseotherwise
-
page
-
filterEntries
public static <K,V> List<Map.Entry<K,V>> filterEntries(MapPredicate<K, V> predicate, Collection<Map.Entry<K, V>> entries) -
toString
-