Class PagingPredicate<K,V>

java.lang.Object
com.loomcache.server.query.PagingPredicate<K,V>
All Implemented Interfaces:
MapPredicate<K,V>

public final class PagingPredicate<K,V> extends Object implements 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 Details

  • Method Details

    • predicate

      public MapPredicate<K,V> predicate()
    • comparator

      public Comparator<? super Map.Entry<K,V>> 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

      public boolean test(K key, V value)
      Description copied from interface: MapPredicate
      Tests whether the given map entry matches this predicate.
      Specified by:
      test in interface MapPredicate<K,V>
      Parameters:
      key - the entry key (non-null)
      value - the entry value (non-null)
      Returns:
      true if the entry matches, false otherwise
    • page

      public List<Map.Entry<K,V>> page(Collection<Map.Entry<K,V>> entries)
    • filterEntries

      public static <K,V> List<Map.Entry<K,V>> filterEntries(MapPredicate<K,V> predicate, Collection<Map.Entry<K,V>> entries)
    • toString

      public String toString()
      Overrides:
      toString in class Object