Class FunctorUtils
java.lang.Object
org.apache.commons.collections4.functors.FunctorUtils
Internal utilities for functors.
- Since:
- 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerce(P predicate) A very simple method that coerces Predicateinvalid input: '<'? super T> to Predicate. (package private) static <T extends Consumer<?>>
T[]copy(T... consumers) Clones the consumers to ensure that the internal references can't be updated.(package private) static <T> Predicate<? super T>[]validate(Collection<? extends Predicate<? super T>> predicates) Validate the predicates to ensure that all is well.(package private) static voidValidates the consumers to ensure that all is well.(package private) static voidValidate method(package private) static voidValidate the predicates to ensure that all is well.
-
Constructor Details
-
FunctorUtils
private FunctorUtils()Restricted constructor.
-
-
Method Details
-
coerce
A very simple method that coerces Predicateinvalid input: '<'? super T> to Predicate. Due to the method, Predicateinvalid input: '<'? super T> is able to be coerced to Predicateinvalid reference
Predicate#test(T)without casting issues. This method exists simply as centralized documentation and atomic unchecked warning suppression.
- Type Parameters:
T- the type of object the returned predicate should "accept"- Parameters:
predicate- the predicate to coerce.- Returns:
- the coerced predicate.
-
coerce
static <R extends Function<I,O>, R coerceP extends Function<? super I, ? extends O>, I, O> (P transformer) A very simple method that coerces Transformerinvalid input: '<'? super I, ? extends O> to Transformerinvalid input: '<'I, O>.This method exists simply as centralized documentation and atomic unchecked warning suppression.
- Type Parameters:
I- the type of object the returned transformer should "accept"O- the type of object the returned transformer should "produce"- Parameters:
transformer- the transformer to coerce.- Returns:
- the coerced transformer.
-
copy
Clones the consumers to ensure that the internal references can't be updated.- Parameters:
consumers- the consumers to copy.- Returns:
- the cloned consumers.
-
copy
Clone the predicates to ensure that the internal reference can't be messed with. Due to themethod, Predicateinvalid input: '<'? super T> is able to be coerced to Predicateinvalid reference
Predicate#test(T)without casting issues. - Parameters:
predicates- the predicates to copy- Returns:
- the cloned predicates
-
copy
Copy method.- Parameters:
transformers- the transformers to copy- Returns:
- a clone of the transformers
-
validate
Validate the predicates to ensure that all is well.- Parameters:
predicates- the predicates to validate- Returns:
- predicate array
-
validate
Validates the consumers to ensure that all is well.- Parameters:
consumers- the consumers to validate.
-
validate
Validate method- Parameters:
functions- the transformers to validate
-
validate
Validate the predicates to ensure that all is well.- Parameters:
predicates- the predicates to validate
-