⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.functors

Class NullIsTruePredicate

java.lang.Object
|
+--org.apache.commons.collections.functors.NullIsTruePredicate

All Implemented Interfaces:
Predicate, Serializable


public final class NullIsTruePredicate
extends java.lang.Object
implements Predicate, Serializable

Predicate implementation that returns true if the input is null.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

NullIsTruePredicate(Predicate predicate)

Constructor that performs no validation.

Method Summary

boolean

evaluate(Object object)

Return true if the object equals null else call the decorated predicate.

static Predicate

getInstance(Predicate predicate)

Factory to create the null true predicate.

Constructor Details

NullIsTruePredicate

public NullIsTruePredicate(Predicate predicate)

Constructor that performs no validation. Use getInstance if you want that.

Parameters:
predicate - the predicate to call after the null check

Method Details

evaluate

public boolean evaluate(Object object)

Return true if the object equals null else call the decorated predicate.

Parameters:
object

getInstance

public static Predicate getInstance(Predicate predicate)

Factory to create the null true predicate.

Parameters:
predicate - the predicate to decorate, not null
Returns:
the predicate
Throws:
- if the predicate is null