net.sf.molae.pipe.filter
Class PredicateProxy<B extends TypedPredicate<? super T>,T>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<B>
      extended by net.sf.molae.pipe.filter.PredicateProxy<B,T>
All Implemented Interfaces:
TypedPredicate<T>

public final class PredicateProxy<B extends TypedPredicate<? super T>,T>
extends ObjectProxy<B>
implements TypedPredicate<T>

A proxy of a predicate. Can be used to change the base class.

Since:
2.0

Constructor Summary
protected PredicateProxy(B base)
          Constructs a new PredicateProxy object.
 
Method Summary
 boolean evaluate(T input)
          Checks if the specified object fulfils a condition.
static
<T> TypedPredicate<T>
newInstance(TypedPredicate<? super T> base)
          Constructs a new PredicateProxy object.
 
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, equals, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PredicateProxy

protected PredicateProxy(B base)
Constructs a new PredicateProxy object.

Parameters:
base - the underlying predicate
Throws:
NullPointerException - if the underlying predicate is null.
Method Detail

newInstance

public static <T> TypedPredicate<T> newInstance(TypedPredicate<? super T> base)
Constructs a new PredicateProxy object.

Parameters:
base - the underlying predicate
Throws:
NullPointerException - if the underlying predicate is null.

evaluate

public boolean evaluate(T input)
Description copied from interface: TypedPredicate
Checks if the specified object fulfils a condition.

Specified by:
evaluate in interface TypedPredicate<T>
Parameters:
input - the object to evaluate, should not be changed
Returns:
result of evaluation