Class BooleanReturningMethodInvoker
- java.lang.Object
-
- org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker
-
public class BooleanReturningMethodInvoker extends Object
Helper class for internal use only. This allows to call a given method and convert the result to a boolean. It will do this by caching the method call as well as the "asBoolean" inCallSiteArrayfashion. "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 inDefaultTypeTransformation.castToBoolean(Object). The purpose of this class is to avoid the slow "asBoolean" call in that method. The nature of this class allows a per instance caching instead of a per class caching like the normalCallSiteArraylogic.
-
-
Constructor Summary
Constructors Constructor Description BooleanReturningMethodInvoker()BooleanReturningMethodInvoker(String methodName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconvertToBoolean(Object arg)booleaninvoke(Object receiver, Object... args)
-
-
-
Constructor Detail
-
BooleanReturningMethodInvoker
public BooleanReturningMethodInvoker()
-
BooleanReturningMethodInvoker
public BooleanReturningMethodInvoker(String methodName)
-
-