Class CompositeFilter<T>

  • All Implemented Interfaces:
    Filter<T>

    class CompositeFilter<T>
    extends java.lang.Object
    implements Filter<T>
    Combines a collection of Filters into a new filter that will include elements if and only if all of the filters in the specified collection include it.
    Since:
    1.0
    • Field Detail

      • ALWAYS_INCLUDED_FILTER

        private static final Filter ALWAYS_INCLUDED_FILTER
      • ALWAYS_INCLUDED_RESULT

        private static final FilterResult ALWAYS_INCLUDED_RESULT
      • INCLUDED_BY_ALL_FILTERS

        private static final FilterResult INCLUDED_BY_ALL_FILTERS
      • filters

        private final java.util.Collection<Filter<T>> filters
    • Constructor Detail

      • CompositeFilter

        CompositeFilter​(java.util.Collection<? extends Filter<T>> filters)
    • Method Detail

      • alwaysIncluded

        static <T> Filter<T> alwaysIncluded()
      • apply

        public FilterResult apply​(T element)
        Description copied from interface: Filter
        Apply this filter to the supplied object.
        Specified by:
        apply in interface Filter<T>
      • toPredicate

        public java.util.function.Predicate<T> toPredicate()
        Description copied from interface: Filter
        Return a Predicate that returns true if this filter includes the object supplied to the predicate's test method.
        Specified by:
        toPredicate in interface Filter<T>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object