Package: org.codehaus.groovy.runtime

## [Java] Class BooleanClosurePredicate<T>

- org.codehaus.groovy.runtime.BooleanClosurePredicate

- All Implemented Interfaces and Traits:
    Predicate

      public class BooleanClosurePredicate<T>
      extends Object
      implements Predicate

  Adapts a Closure to a Predicate, converting the closure's return value to a boolean using Groovy truth semantics.

  Since:
    6.0.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `BooleanClosurePredicate(Closure wrapped)` Constructs a BooleanClosurePredicate from a Closure.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `test(T arg)` Tests the given value using the wrapped closure with Groovy truth conversion.

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### public BooleanClosurePredicate(Closure wrapped)

      Constructs a BooleanClosurePredicate from a Closure.

      Parameters:
        `wrapped` - the Closure to adapt to a predicate

  - ### Method Detail

    - #### public boolean test(T arg)

      Tests the given value using the wrapped closure with Groovy truth conversion.

      Parameters:
        `arg` - the value to test
      Returns:
        `true` if the closure result is truthy by Groovy standards, `false` otherwise