- Returns:
- a version of this closure which implements Writable.
- Returns:
- the delegate Object to which method calls will go which is typically the outer class when the closure is constructed
- Returns:
- Returns the directive.
- Returns:
- the maximum number of parameters a doCall method of this closure can take
- Returns:
- the owner Object to which method calls will go which is typically the outer class when the closure is constructed
- Returns:
- the parameter types of the longest doCall method of this closure
- Parameters:
directive- The directive to set.
| Type Params | Return Type | Name and description |
|---|---|---|
<W> |
public Closure<W> |
andThen(Closure<W> other)Alias for rightShift(Closure) |
|
public Closure<V> |
andThenSelf()Call andThen(Closure) on this. |
|
public Closure<V> |
andThenSelf(int times)Call andThen(Closure) on this exactly times times. |
|
public Closure |
asWritable() |
|
public V |
call()Invokes the closure with no arguments, returning any value if applicable. |
|
public V |
call(Object arguments)Invokes the closure with given argument(s), returning any value if applicable. |
|
public V |
call(Object arguments)Invokes the closure with given argument(s), returning any value if applicable. |
|
public Object |
clone() |
|
public Closure<V> |
compose(Closure other)Alias for leftShift(Closure) |
|
public Closure<V> |
composeSelf()Call compose(Closure) on this. |
|
public Closure<V> |
composeSelf(int times)Call compose(Closure) on this exactly times times. |
|
public Closure<V> |
curry(Object arguments)Support for Closure currying. |
|
public Closure<V> |
curry(Object argument)Support for Closure currying. |
|
public Closure<V> |
dehydrate()Returns a copy of this closure where the "owner", "delegate" and "thisObject" fields are null, allowing proper serialization when one of them is not serializable. |
|
public Object |
doCall(Object args) |
|
public Object |
getDelegate() |
|
public int |
getDirective() |
|
public int |
getMaximumNumberOfParameters() |
|
public Object |
getOwner() |
|
public Class<?>[] |
getParameterTypes() |
|
public Object |
getProperty(String property) |
|
public int |
getResolveStrategy()Gets the strategy which the closure uses to resolve methods and properties |
|
public Object |
getThisObject() |
|
public boolean |
isCase(Object switchValue) |
|
public Closure<V> |
leftShift(Closure other)Support for Closure reverse composition. |
|
public V |
leftShift(Object arg)Alias for calling a Closure for non-closure arguments. |
|
public Closure<V> |
memoize()Creates a caching variant of the closure. |
|
public Closure<V> |
memoizeAtLeast(int protectedCacheSize)Creates a caching variant of the closure with automatic cache size adjustment and lower limit on the cache size. |
|
public Closure<V> |
memoizeAtMost(int maxCacheSize)Creates a caching variant of the closure with upper limit on the cache size. |
|
public Closure<V> |
memoizeBetween(int protectedCacheSize, int maxCacheSize)Creates a caching variant of the closure with automatic cache size adjustment and lower and upper limits on the cache size. |
|
public Closure<V> |
ncurry(int n, Object arguments)Support for Closure currying at a given index. |
|
public Closure<V> |
ncurry(int n, Object argument)Support for Closure currying at a given index. |
|
public Closure<V> |
rcurry(Object arguments)Support for Closure "right" currying. |
|
public Closure<V> |
rcurry(Object argument)Support for Closure "right" currying. |
|
public Closure<V> |
rehydrate(Object delegate, Object owner, Object thisObject)Returns a copy of this closure for which the delegate, owner and thisObject are replaced with the supplied parameters. |
<W> |
public Closure<W> |
rightShift(Closure<W> other)Support for Closure forward composition. |
|
public void |
run() |
|
public void |
setDelegate(Object delegate)Allows the delegate to be changed such as when performing markup building |
|
public void |
setDirective(int directive) |
|
public void |
setProperty(String property, Object newValue) |
|
public void |
setResolveStrategy(int resolveStrategy)Sets the strategy which the closure uses to resolve property references and methods. |
|
protected static Object |
throwRuntimeException(Throwable throwable) |
|
public Closure<V> |
trampoline(Object args)Builds a trampolined variant of the current closure. |
|
public Closure<V> |
trampoline()Builds a trampolined variant of the current closure. |