Class PredicateFilterMessageStoreSearcher<Q,K,M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>

  • Type Parameters:
    M - The message type in the store.
    F - The message field type.
    All Implemented Interfaces:
    MessageSearcher<Q,M,F>, Searcher<Q,M>

    public class PredicateFilterMessageStoreSearcher<Q,K,M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>
    extends java.lang.Object
    implements MessageSearcher<Q,M,F>
    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.
    • Method Detail

      • search

        @Nonnull
        public java.util.List<M> search​(@Nonnull
                                        Q query)
        Description copied from interface: MessageSearcher
        Look up a set of keys from the storage.
        Specified by:
        search in interface MessageSearcher<Q,K,M extends net.morimekta.providence.PMessage<M,F>>
        Specified by:
        search in interface Searcher<Q,K>
        Parameters:
        query - The search to query.
        Returns:
        List of all M that matches Query Q.
      • stream

        @Nonnull
        public java.util.stream.Stream<M> stream​(@Nonnull
                                                 Q query)
        Description copied from interface: Searcher
        Run a query and stream the resulting items.
        Specified by:
        stream in interface Searcher<Q,K>
        Parameters:
        query - The search query.
        Returns:
        Stream of all R that matches Query Q.