|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.runtime.callsite.BooleanClosureWrapper
public class BooleanClosureWrapper extends java.lang.Object
Helper class for internal use only. This allows to call a Closure and convert the result to a boolean. It will do this by caching the possible "doCall" as well as the "asBoolean" in CallSiteArray fashion. "asBoolean" will not be called if the result is null or a Boolean. In case of null we return false and in case of a Boolean we simply unbox. This logic is designed after the one present in DefaultTypeTransformation.castToBoolean. The purpose of this class is to avoid the slow "asBoolean" call in that method. BooleanReturningMethodInvoker is used for caching.
Constructor Summary | |
BooleanClosureWrapper(Closure wrapped)
|
Method Summary | |
---|---|
boolean
|
call(java.lang.Object... args)
normal closure call |
boolean
|
callForMap(java.util.Map$Entry entry)
Bridge for a call based on a map entry. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public BooleanClosureWrapper(Closure wrapped)
Method Detail |
---|
public boolean call(java.lang.Object... args)
public boolean callForMap(java.util.Map$Entry entry)
Groovy Documentation