org.apache.camel.impl
Class BinaryPredicateSupport<E extends Exchange>

java.lang.Object
  extended by org.apache.camel.impl.BinaryPredicateSupport<E>
All Implemented Interfaces:
Predicate<E>

public abstract class BinaryPredicateSupport<E extends Exchange>
extends Object
implements Predicate<E>

A useful base class for Predicate implementations

Version:
$Revision: 35332 $

Constructor Summary
protected BinaryPredicateSupport(Expression<E> left, Expression<E> right)
           
 
Method Summary
protected  String assertionFailureMessage(E exchange, Object leftValue, Object rightValue)
           
 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.
protected abstract  String getOperationText()
           
 boolean matches(E exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
protected abstract  boolean matches(E exchange, Object leftValue, Object rightValue)
           
 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<E> left,
                                 Expression<E> right)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

matches

public boolean matches(E 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<E extends Exchange>
Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

assertMatches

public void assertMatches(String text,
                          E exchange)
Description copied from interface: Predicate
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.

Specified by:
assertMatches in interface Predicate<E extends Exchange>
Parameters:
text - the description to use in the exception message
exchange - the exchange to evaluate the expression on

matches

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

getOperationText

protected abstract String getOperationText()

assertionFailureMessage

protected String assertionFailureMessage(E exchange,
                                         Object leftValue,
                                         Object rightValue)


Copyright © 2008 IONA Open Source Community. All Rights Reserved.