class FunctorUtils
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
FunctorUtils()
Restricted constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <T> Closure<T> |
coerce(Closure<? super T> closure)
A very simple method that coerces Closure super T> to Closure
|
(package private) static <T> Predicate<T> |
coerce(Predicate<? super T> predicate)
A very simple method that coerces Predicate 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 Transformer super I, ? extends O> to Transformer.
|
(package private) static <E> Closure<E>[] |
copy(Closure<? super E>... closures)
Clone the closures to ensure that the internal reference can't be messed with.
|
(package private) static <T> Predicate<T>[] |
copy(Predicate<? super T>... predicates)
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 void |
validate(Closure<?>... closures)
Validate the closures to ensure that all is well.
|
(package private) static <T> Predicate<? super T>[] |
validate(java.util.Collection<? extends Predicate<? super T>> predicates)
Validate the predicates to ensure that all is well.
|
(package private) static void |
validate(Predicate<?>... predicates)
Validate the predicates to ensure that all is well.
|
(package private) static void |
validate(Transformer<?,?>... transformers)
Validate method
|
static <T> Predicate<T>[] copy(Predicate<? super T>... predicates)
Predicate#evaluate(T)
method, Predicate super T> is
able to be coerced to Predicatepredicates
- the predicates to copystatic <T> Predicate<T> coerce(Predicate<? super T> predicate)
Predicate#evaluate(T)
method, Predicate super T> is
able to be coerced to PredicateThis method exists simply as centralised documentation and atomic unchecked warning suppression.
T
- the type of object the returned predicate should "accept"predicate
- the predicate to coerce.static void validate(Predicate<?>... predicates)
predicates
- the predicates to validatestatic <T> Predicate<? super T>[] validate(java.util.Collection<? extends Predicate<? super T>> predicates)
predicates
- the predicates to validatestatic <E> Closure<E>[] copy(Closure<? super E>... closures)
closures
- the closures to copystatic void validate(Closure<?>... closures)
closures
- the closures to validatestatic <T> Closure<T> coerce(Closure<? super T> closure)
This method exists simply as centralised documentation and atomic unchecked warning suppression.
T
- the type of object the returned closure should "accept"closure
- the closure to coerce.static <I,O> Transformer<I,O>[] copy(Transformer<? super I,? extends O>... transformers)
transformers
- the transformers to copystatic void validate(Transformer<?,?>... transformers)
transformers
- the transformers to validatestatic <I,O> Transformer<I,O> coerce(Transformer<? super I,? extends O> transformer)
This method exists simply as centralised documentation and atomic unchecked warning suppression.
T
- the type of object the returned transformer should "accept"transformer
- the transformer to coerce.