Package: org.codehaus.groovy.runtime

## [Java] Class BooleanClosureWrapper

- org.codehaus.groovy.runtime.BooleanClosureWrapper

-     public class BooleanClosureWrapper
      extends Object

  Helper class for internal use only. This allows calling a Closure and converting the result to a boolean using Groovy truth semantics: null returns false, Boolean is unboxed, and for other types `asBoolean()` is called.

  Since:
    6.0.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `BooleanClosureWrapper(Closure wrapped)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `call(Object args)` Normal closure call with boolean conversion.
    `<K, V>` | `public boolean` | `callForMap(Map.Entry<K, V> entry)` Bridge for a call based on a map entry.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public BooleanClosureWrapper(Closure wrapped)

  - ### Method Detail

    - #### public boolean call(Object args)

      Normal closure call with boolean conversion.

    - #### <K, V> public boolean callForMap(Map.Entry<K, V> entry)

      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.