Package cz.o2.proxima.tools.groovy.util
Class Closures
- java.lang.Object
-
- cz.o2.proxima.tools.groovy.util.Closures
-
public class Closures extends java.lang.Object
Utilities related to creatingClosure
s from Java.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> groovy.lang.Closure<T>
from(java.lang.Object owner, BiFunction<java.lang.Object,java.lang.Object,T> lambda)
CreateClosure
from provided java lambda.static <T> groovy.lang.Closure<T>
from(java.lang.Object owner, Factory<T> lambda)
CreateClosure
from provided java lambda.static <T> groovy.lang.Closure<T>
from(java.lang.Object owner, UnaryFunction<java.lang.Object,T> lambda)
CreateClosure
from provided java lambda.static <T> groovy.lang.Closure<T>
fromArray(java.lang.Object owner, UnaryFunction<java.lang.Object[],T> lambda)
CreateClosure
from provided java lambda.
-
-
-
Method Detail
-
from
public static <T> groovy.lang.Closure<T> from(java.lang.Object owner, Factory<T> lambda)
CreateClosure
from provided java lambda.- Type Parameters:
T
- type parameter- Parameters:
owner
- owner of the resultingClosure
lambda
- lambda supplier of resulting objects- Returns:
- the closure
-
from
public static <T> groovy.lang.Closure<T> from(java.lang.Object owner, UnaryFunction<java.lang.Object,T> lambda)
CreateClosure
from provided java lambda.- Type Parameters:
T
- type parameter- Parameters:
owner
- owner of the resultingClosure
lambda
- lambda function from Object to output type- Returns:
- the closure
-
from
public static <T> groovy.lang.Closure<T> from(java.lang.Object owner, BiFunction<java.lang.Object,java.lang.Object,T> lambda)
CreateClosure
from provided java lambda.- Type Parameters:
T
- type parameter- Parameters:
owner
- owner of the resultingClosure
lambda
- lambda function of two arguments to output type- Returns:
- the closure
-
fromArray
public static <T> groovy.lang.Closure<T> fromArray(java.lang.Object owner, UnaryFunction<java.lang.Object[],T> lambda)
CreateClosure
from provided java lambda.- Type Parameters:
T
- type parameter- Parameters:
owner
- owner of the resultingClosure
lambda
- lambda function from Object[] to output type- Returns:
- the closure
-
-