Class PredicateTransformer<T>

    • Constructor Detail

      • PredicateTransformer

        public PredicateTransformer​(Predicate<? super T> predicate)
        Constructor that performs no validation. Use predicateTransformer if you want that.
        Parameters:
        predicate - the predicate to call, not null
    • Method Detail

      • predicateTransformer

        public static <T> Transformer<T,​Boolean> predicateTransformer​(Predicate<? super T> predicate)
        Factory method that performs validation.
        Type Parameters:
        T - the input type
        Parameters:
        predicate - the predicate to call, not null
        Returns:
        the predicate transformer
        Throws:
        IllegalArgumentException - if the predicate is null
      • transform

        public Boolean transform​(T input)
        Transforms the input to result by calling a predicate.
        Specified by:
        transform in interface Transformer<T,​Boolean>
        Parameters:
        input - the input object to transform
        Returns:
        the transformed result
      • getPredicate

        public Predicate<? super T> getPredicate()
        Gets the predicate.
        Returns:
        the predicate
        Since:
        3.1