Class BooleanClosureWrapper

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

@Deprecated(since="6.0.0", forRemoval=true) public class BooleanClosureWrapper 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 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(Object). The purpose of this class is to avoid the slow "asBoolean" call in that method. BooleanReturningMethodInvoker is used for caching.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    call(Object... args)
    Deprecated, for removal: This API element is subject to removal in a future version.
    normal closure call
    <K, V> boolean
    callForMap(Map.Entry<K,V> entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Bridge for a call based on a map entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BooleanClosureWrapper

      public BooleanClosureWrapper(Closure wrapped)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • call

      public boolean call(Object... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      normal closure call
    • callForMap

      public <K, V> boolean callForMap(Map.Entry<K,V> entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Bridge for a call based on a map entry. If the call is done on a Closure taking one argument, then we give in the Map.Entry, otherwise we will give in the key and value.