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 TypeMethodDescription(package private) static <T> Closure
<T> A very simple method that coerces Closureinvalid input: '<'? super T> to Closure. (package private) static <T> Predicate
<T> A very simple method that coerces Predicateinvalid input: '<'? super T> to Predicate. (package private) static <I,
O> Transformer <I, O> coerce
(Transformer<? super I, ? extends O> transformer) A very simple method that coerces Transformerinvalid input: '<'? super I, ? extends O> to Transformerinvalid input: '<'I, O>.(package private) static <E> Closure<E>[]
Clone the closures to ensure that the internal reference can't be messed with.(package private) static <T> Predicate<T>[]
Clone the predicates to ensure that the internal reference can't be messed with.(package private) static <I,
O> Transformer<I, O>[] copy
(Transformer<? super I, ? extends O>... transformers) Copy method(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 void
Validate the closures to ensure that all is well.(package private) static void
Validate the predicates to ensure that all is well.(package private) static void
validate
(Transformer<?, ?>... transformers) Validate method
-
Constructor Details
-
FunctorUtils
private FunctorUtils()Restricted constructor.
-
-
Method Details
-
copy
Clone the predicates to ensure that the internal reference can't be messed with. Due to theinvalid reference
Predicate#evaluate(T)
without casting issues. - Parameters:
predicates
- the predicates to copy- Returns:
- the cloned predicates
-
coerce
A very simple method that coerces Predicateinvalid input: '<'? super T> to Predicate. Due to the invalid reference
Predicate#evaluate(T)
without casting issues. This method exists simply as centralised 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.
-
validate
Validate the predicates to ensure that all is well.- Parameters:
predicates
- the predicates to validate
-
validate
Validate the predicates to ensure that all is well.- Parameters:
predicates
- the predicates to validate- Returns:
- predicate array
-
copy
Clone the closures to ensure that the internal reference can't be messed with.- Parameters:
closures
- the closures to copy- Returns:
- the cloned closures
-
validate
Validate the closures to ensure that all is well.- Parameters:
closures
- the closures to validate
-
coerce
A very simple method that coerces Closureinvalid input: '<'? super T> to Closure. This method exists simply as centralised documentation and atomic unchecked warning suppression.
- Type Parameters:
T
- the type of object the returned closure should "accept"- Parameters:
closure
- the closure to coerce.- Returns:
- the coerced closure.
-
copy
Copy method- Parameters:
transformers
- the transformers to copy- Returns:
- a clone of the transformers
-
validate
Validate method- Parameters:
transformers
- the transformers to validate
-
coerce
A very simple method that coerces Transformerinvalid input: '<'? super I, ? extends O> to Transformerinvalid input: '<'I, O>.This method exists simply as centralised 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.
-