Package net.morimekta.providence.storage
Class PredicateFilterMessageStoreSearcher<Q,K,M extends PMessage<M>>
- java.lang.Object
-
- net.morimekta.providence.storage.PredicateFilterMessageStoreSearcher<Q,K,M>
-
- Type Parameters:
Q
- The query type.K
- The store's key type.M
- The message type in the store.
- All Implemented Interfaces:
MessageSearcher<Q,M>
,Searcher<Q,M>
public class PredicateFilterMessageStoreSearcher<Q,K,M extends PMessage<M>> extends java.lang.Object implements MessageSearcher<Q,M>
Simple store searcher that finds all messages in a given store that matches a simple java predicate. Note that this will always load all the data from the store in order to do the search.
-
-
Constructor Summary
Constructors Constructor Description PredicateFilterMessageStoreSearcher(MessageReadOnlyStore<K,M> store, java.util.function.BiPredicate<M,Q> biPredicate)
PredicateFilterMessageStoreSearcher(MessageReadOnlyStore<K,M> store, PredicateFilterMessageStoreSearcher.PredicateFilter<Q,K,M> predicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<M>
search(Q query)
Run a query and return the resulting items.java.util.stream.Stream<M>
stream(Q query)
Run a query and stream the resulting items.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.storage.MessageSearcher
searchBuilders
-
-
-
-
Constructor Detail
-
PredicateFilterMessageStoreSearcher
public PredicateFilterMessageStoreSearcher(MessageReadOnlyStore<K,M> store, java.util.function.BiPredicate<M,Q> biPredicate)
-
PredicateFilterMessageStoreSearcher
public PredicateFilterMessageStoreSearcher(MessageReadOnlyStore<K,M> store, PredicateFilterMessageStoreSearcher.PredicateFilter<Q,K,M> predicate)
-
-