net.sf.staccatocommons.defs
Interface Evaluable<T>

Type Parameters:
T - the type of object that can be evaluated
All Known Subinterfaces:
Predicate<A>

@Applicative
public interface Evaluable<T>

Evaluables are boolean conditions over an argument that can be tested using its eval(Object) message.

Evaluable has the same semantics that an Applicable of Boolean return type, but is provided for ease of coding. Concrete implementors should implement Applicable as well.

Author:
flbulgarelli
See Also:
Recomendations for implementing

Method Summary
 boolean eval(T argument)
          Evaluates an argument.
 

Method Detail

eval

boolean eval(T argument)
Evaluates an argument. If the argument evaluates to true is said to satisfy or meet this condition. Evaluable implementors should not try to handle nulls. Instead, the preferred way of getting a null safe Evaluable is composing it with the null or non-null predicates from staccato-commons-lang:
 Predicates.null_().or(theActualEvaluable)
 Predicates.notNull().and(theActualEvaluable)
 

Parameters:
argument - the argument to evaluate.
Returns:
if the argument meets this evaluable condition


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads