Interface Filter<T>

    • Method Detail

      • composeFilters

        @SafeVarargs
        static <T> Filter<T> composeFilters​(Filter<T>... filters)
        Return a filter that will include elements if and only if all of the filters in the supplied array of filters include it.

        If the array is empty, the returned filter will include all elements it is asked to filter.

        Parameters:
        filters - the array of filters to compose; never null
        See Also:
        composeFilters(Collection)
      • composeFilters

        static <T> Filter<T> composeFilters​(Collection<? extends Filter<T>> filters)
        Return a filter that will include elements if and only if all of the filters in the supplied collection of filters include it.

        If the collection is empty, the returned filter will include all elements it is asked to filter.

        Parameters:
        filters - the collection of filters to compose; never null
        See Also:
        composeFilters(Filter...)
      • adaptFilter

        static <T,​V> Filter<T> adaptFilter​(Filter<V> adaptee,
                                                 Function<T,​V> converter)
        Return a filter that will include elements if and only if the adapted Filter includes the value converted using the supplied Function.
        Parameters:
        adaptee - the filter to be adapted
        converter - the converter function to apply
      • apply

        FilterResult apply​(T object)
        Apply this filter to the supplied object.
      • toPredicate

        default Predicate<T> toPredicate()
        Return a Predicate that returns true if this filter includes the object supplied to the predicate's test method.