org.apache.camel
Interface Predicate<E>

All Known Implementing Classes:
BeanExpression, BeanShellExpression, BinaryPredicateSupport, BinaryPredicateSupport, ConstantExpression, ELExpression, ExpressionClause, ExpressionSupport, ExpressionType, GroovyExpression, HeaderExpression, JavaScriptExpression, JXPathExpression, LanguageExpression, MethodCallExpression, NamespaceAwareExpression, OgnlExpression, PhpExpression, PredicateSupport, PredicateSupport, PythonExpression, RubyExpression, SimpleExpression, SqlExpression, XPathBuilder, XPathExpression, XQueryExpression

public interface Predicate<E>

Evaluates a binary predicate on the message exchange to support things like scripting languages, XQuery or SQL as well as any arbitrary Java expression.

Version:
$Revision: 630591 $

Method Summary
 void assertMatches(String text, E exchange)
          Allows this predicate to be used nicely in testing to generate a nicely formatted exception and message if this predicate does not match for the given exchange.
 boolean matches(E exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
 

Method Detail

matches

boolean matches(E exchange)
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate

Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

assertMatches

void assertMatches(String text,
                   E exchange)
                   throws AssertionError
Allows this predicate to be used nicely in testing to generate a nicely formatted exception and message if this predicate does not match for the given exchange.

Parameters:
text - the description to use in the exception message
exchange - the exchange to evaluate the expression on
Throws:
AssertionError - if the predicate does not match


Apache CAMEL