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

Class NullIsExceptionPredicate

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

All Implemented Interfaces:
Predicate, Serializable


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

Predicate implementation that throws an exception if the input is null.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

NullIsExceptionPredicate(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 exception predicate.

Constructor Details

NullIsExceptionPredicate

public NullIsExceptionPredicate(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 exception predicate.

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