Class PredicateUtils


  • public final class PredicateUtils
    extends Object
    Utility for Predicates.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • PredicateUtils

        public PredicateUtils()
    • Method Detail

      • compose

        public static <A,​B> Predicate<A> compose​(Predicate<B> predicate,
                                                       Function<A,​? extends B> function)
        Returns the composition of a function and a predicate. For every x, the generated predicate returns predicate(function(x)).
        Type Parameters:
        A - Type of the items that can be tested by the composed predicate.
        B - Type of the items that can be tested by the predicate to compose.
        Parameters:
        predicate - Predicate to compose.
        function - Mapping function.
        Returns:
        the composition of the provided function and predicate