Package org.codehaus.groovy.runtime

# Class BooleanClosureWrapper

java.lang.Object
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
  Description
  `BooleanClosureWrapper(Closure wrapped)`
  Constructs a BooleanClosureWrapper from a Closure.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `call(Object... args)`
  Normal closure call with boolean conversion.
  `<K, V> boolean`
  `callForMap(Map.Entry<K,V> entry)`
  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)
    Constructs a BooleanClosureWrapper from a Closure.
    Parameters:
      `wrapped` - the `Closure` to wrap for boolean conversion

- ## Method Details

  - ### call

    public boolean call(Object... args)
    Normal closure call with boolean conversion.

  - ### callForMap

    public <K, V> 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.