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

Class InstanceofPredicate

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

All Implemented Interfaces:
Predicate, Serializable


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

Predicate implementation that returns true if the input is an instanceof the type stored in this predicate.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

InstanceofPredicate(Class type)

Constructor that performs no validation.

Method Summary

boolean

evaluate(Object object)

Return the predicate result.

static Predicate

getInstance(Class type)

Factory to create the identity predicate.

Constructor Details

InstanceofPredicate

public InstanceofPredicate(Class type)

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

Parameters:
type - the type to check for

Method Details

evaluate

public boolean evaluate(Object object)

Return the predicate result.

Parameters:
object

getInstance

public static Predicate getInstance(Class type)

Factory to create the identity predicate.

Parameters:
type - the type to check for, may not be null
Returns:
the predicate
Throws:
- if the class is null