org.apache.camel.builder
Class PredicateBuilder

java.lang.Object
  extended by org.apache.camel.builder.PredicateBuilder

public final class PredicateBuilder
extends Object

A helper class for working with predicates

Version:
$Revision: 688281 $

Method Summary
static
<E extends Exchange>
Predicate<E>
and(Predicate<E> left, Predicate<E> right)
          A helper method to combine multiple predicates by a logical AND
static
<E extends Exchange>
Predicate<E>
contains(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isEqualTo(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isGreaterThan(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isGreaterThanOrEqualTo(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isInstanceOf(Expression<E> expression, Class type)
           
static
<E extends Exchange>
Predicate<E>
isLessThan(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isLessThanOrEqualTo(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isNotEqualTo(Expression<E> left, Expression<E> right)
           
static
<E extends Exchange>
Predicate<E>
isNotNull(Expression<E> expression)
           
static
<E extends Exchange>
Predicate<E>
isNull(Expression<E> expression)
           
static
<E extends Exchange>
Predicate<E>
not(Predicate<E> predicate)
          A helper method to return the logical not of the given predicate
static
<E extends Exchange>
Predicate<E>
or(Predicate<E> left, Predicate<E> right)
          A helper method to combine multiple predicates by a logical OR
static
<E extends Exchange>
Predicate<E>
regex(Expression<E> expression, Pattern pattern)
          Returns a predicate which is true if the expression matches the given regular expression
static
<E extends Exchange>
Predicate<E>
regex(Expression<E> expression, String regex)
          Returns a predicate which is true if the expression matches the given regular expression
static
<E extends Exchange>
Predicate<E>
toPredicate(Expression<E> expression)
          Converts the given expression into an Predicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toPredicate

public static <E extends Exchange> Predicate<E> toPredicate(Expression<E> expression)
Converts the given expression into an Predicate


not

public static <E extends Exchange> Predicate<E> not(Predicate<E> predicate)
A helper method to return the logical not of the given predicate


and

public static <E extends Exchange> Predicate<E> and(Predicate<E> left,
                                                    Predicate<E> right)
A helper method to combine multiple predicates by a logical AND


or

public static <E extends Exchange> Predicate<E> or(Predicate<E> left,
                                                   Predicate<E> right)
A helper method to combine multiple predicates by a logical OR


isEqualTo

public static <E extends Exchange> Predicate<E> isEqualTo(Expression<E> left,
                                                          Expression<E> right)

isNotEqualTo

public static <E extends Exchange> Predicate<E> isNotEqualTo(Expression<E> left,
                                                             Expression<E> right)

isLessThan

public static <E extends Exchange> Predicate<E> isLessThan(Expression<E> left,
                                                           Expression<E> right)

isLessThanOrEqualTo

public static <E extends Exchange> Predicate<E> isLessThanOrEqualTo(Expression<E> left,
                                                                    Expression<E> right)

isGreaterThan

public static <E extends Exchange> Predicate<E> isGreaterThan(Expression<E> left,
                                                              Expression<E> right)

isGreaterThanOrEqualTo

public static <E extends Exchange> Predicate<E> isGreaterThanOrEqualTo(Expression<E> left,
                                                                       Expression<E> right)

contains

public static <E extends Exchange> Predicate<E> contains(Expression<E> left,
                                                         Expression<E> right)

isNull

public static <E extends Exchange> Predicate<E> isNull(Expression<E> expression)

isNotNull

public static <E extends Exchange> Predicate<E> isNotNull(Expression<E> expression)

isInstanceOf

public static <E extends Exchange> Predicate<E> isInstanceOf(Expression<E> expression,
                                                             Class type)

regex

public static <E extends Exchange> Predicate<E> regex(Expression<E> expression,
                                                      String regex)
Returns a predicate which is true if the expression matches the given regular expression

Parameters:
expression - the expression to evaluate
regex - the regular expression to match against
Returns:
a new predicate

regex

public static <E extends Exchange> Predicate<E> regex(Expression<E> expression,
                                                      Pattern pattern)
Returns a predicate which is true if the expression matches the given regular expression

Parameters:
expression - the expression to evaluate
pattern - the regular expression to match against
Returns:
a new predicate


Apache CAMEL