BooleanClosureForMapPredicate (Groovy 5.1.0)
Description: declaration: package: org.codehaus.groovy.runtime.callsite, class: BooleanClosureForMapPredicate

Package org.codehaus.groovy.runtime.callsite

# Class BooleanClosureForMapPredicate<K,V>

java.lang.Object
org.codehaus.groovy.runtime.callsite.BooleanClosureForMapPredicate<K,V>

All Implemented Interfaces:
  `Predicate<Map.Entry<K,V>>`

public class BooleanClosureForMapPredicate<K,V> extends Object implements Predicate<Map.Entry<K,V>>
Helper class for internal use only. This creates a Predicate by calling a `Closure` and converting the result to a boolean. `BooleanReturningMethodInvoker` is used for caching.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BooleanClosureForMapPredicate(Closure wrapped)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `test(Map.Entry<K,V> entry)`
  If the call to the backing `Closure` is done on a `Closure` taking one argument, then we give in the `Map.Entry`, otherwise we will give in the key and value.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Predicate

  `and, negate, or`

- ## Constructor Details

  - ### BooleanClosureForMapPredicate

    public BooleanClosureForMapPredicate(Closure wrapped)

- ## Method Details

  - ### test

    public boolean test(Map.Entry<K,V> entry)
    If the call to the backing `Closure` is done on a `Closure` taking one argument, then we give in the `Map.Entry`, otherwise we will give in the key and value.
    Specified by:
      `test` in interface `Predicate<K>`