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 Details

    • BooleanClosureWrapper

      public BooleanClosureWrapper(Closure wrapped)
  • 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.