Package org.codehaus.groovy.runtime.callsite

# Class BooleanReturningMethodInvoker

java.lang.Object
org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker

@Deprecated(since="6.0.0", forRemoval=true) public class BooleanReturningMethodInvoker extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
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" 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(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 normal `CallSiteArray` logic.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BooleanReturningMethodInvoker()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `BooleanReturningMethodInvoker(String methodName)`
  Deprecated, for removal: This API element is subject to removal in a future version.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `convertToBoolean(Object arg)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `boolean`
  `invoke(Object receiver, Object... args)`
  Deprecated, for removal: This API element is subject to removal in a future version.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BooleanReturningMethodInvoker

    public BooleanReturningMethodInvoker()
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### BooleanReturningMethodInvoker

    public BooleanReturningMethodInvoker(String methodName)
    Deprecated, for removal: This API element is subject to removal in a future version.

- ## Method Details

  - ### invoke

    public boolean invoke(Object receiver, Object... args)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### convertToBoolean

    public boolean convertToBoolean(Object arg)
    Deprecated, for removal: This API element is subject to removal in a future version.