org.apache.camel.builder
Class BinaryPredicateSupport

java.lang.Object
  extended by org.apache.camel.builder.BinaryPredicateSupport
All Implemented Interfaces:
BinaryPredicate, Predicate
Direct Known Subclasses:
TimeClause

public abstract class BinaryPredicateSupport
extends Object
implements BinaryPredicate

A useful base class for Predicate implementations

Version:

Constructor Summary
protected BinaryPredicateSupport(Expression left, Expression right)
           
 
Method Summary
 Expression getLeft()
          Gets the left hand side expression
protected abstract  String getOperationText()
           
 String getOperator()
          Gets the operator
 Expression getRight()
          Gets the right hand side expression
 boolean matches(Exchange exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
protected abstract  boolean matches(Exchange exchange, Object leftValue, Object rightValue)
           
 String matchesReturningFailureMessage(Exchange exchange)
          Evaluates the predicate on the message exchange and returns null if this exchange matches the predicate.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryPredicateSupport

protected BinaryPredicateSupport(Expression left,
                                 Expression right)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

matches

public boolean matches(Exchange exchange)
Description copied from interface: Predicate
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate

Specified by:
matches in interface Predicate
Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

matchesReturningFailureMessage

public String matchesReturningFailureMessage(Exchange exchange)
Description copied from interface: BinaryPredicate
Evaluates the predicate on the message exchange and returns null if this exchange matches the predicate. If it did not match, then a failure message is returned detailing the reason, which can be used by end users to understand the failure.

Specified by:
matchesReturningFailureMessage in interface BinaryPredicate
Parameters:
exchange - the message exchange
Returns:
null if the predicate matches.

matches

protected abstract boolean matches(Exchange exchange,
                                   Object leftValue,
                                   Object rightValue)

getOperationText

protected abstract String getOperationText()

getLeft

public Expression getLeft()
Description copied from interface: BinaryPredicate
Gets the left hand side expression

Specified by:
getLeft in interface BinaryPredicate
Returns:
the left expression

getRight

public Expression getRight()
Description copied from interface: BinaryPredicate
Gets the right hand side expression

Specified by:
getRight in interface BinaryPredicate
Returns:
the right expression

getOperator

public String getOperator()
Description copied from interface: BinaryPredicate
Gets the operator

Specified by:
getOperator in interface BinaryPredicate
Returns:
the operator text


Apache CAMEL