public class BooleanClosureForMapPredicate<K, V>
extends Object
implements Predicate
Adapts a Closure to a Predicate over Map.Entry values. If the closure takes two parameters, the key and value are passed separately; otherwise the Map.Entry itself is passed.
| Constructor and description |
|---|
BooleanClosureForMapPredicate(Closure wrapped)Constructs a BooleanClosureForMapPredicate from a Closure. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
test(Map.Entry<K, V> entry)Tests the given map entry using the wrapped closure with Groovy truth conversion. |
Tests the given map entry using the wrapped closure with Groovy truth conversion. If the closure takes two parameters, key and value are passed separately; otherwise the entry itself is passed.
entry - the Map.Entry to testtrue if the closure result is truthy by Groovy standards, false otherwiseCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.