Class PredicateBuilder

java.lang.Object
org.apache.camel.support.builder.PredicateBuilder

public class PredicateBuilder extends Object
A helper class for working with predicates
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.camel.Predicate
    and(List<org.apache.camel.Predicate> predicates)
    Concat the given predicates into a single predicate, which only matches if all the predicates matches.
    static org.apache.camel.Predicate
    and(org.apache.camel.Predicate... predicates)
    Concat the given predicates into a single predicate, which only matches if all the predicates matches.
    static org.apache.camel.Predicate
    and(org.apache.camel.Predicate left, org.apache.camel.Predicate right)
    A helper method to combine multiple predicates by a logical AND
    static org.apache.camel.Predicate
    constant(boolean answer)
    A constant predicate.
    static org.apache.camel.Predicate
    contains(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    containsIgnoreCase(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    endsWith(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    in(List<org.apache.camel.Predicate> predicates)
    A helper method to return true if any of the predicates matches.
    static org.apache.camel.Predicate
    in(org.apache.camel.Predicate... predicates)
    A helper method to return true if any of the predicates matches.
    static org.apache.camel.Predicate
    isEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isEqualToIgnoreCase(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isGreaterThan(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isGreaterThanOrEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isInstanceOf(org.apache.camel.Expression expression, Class<?> type)
     
    static org.apache.camel.Predicate
    isLessThan(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isLessThanOrEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isNotEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    isNotNull(org.apache.camel.Expression expression)
     
    static org.apache.camel.Predicate
    isNull(org.apache.camel.Expression expression)
     
    static org.apache.camel.Predicate
    not(org.apache.camel.Predicate predicate)
    A helper method to return the logical not of the given predicate
    static org.apache.camel.Predicate
    or(List<org.apache.camel.Predicate> predicates)
    Concat the given predicates into a single predicate, which matches if at least one predicates matches.
    static org.apache.camel.Predicate
    or(org.apache.camel.Predicate... predicates)
    Concat the given predicates into a single predicate, which matches if at least one predicates matches.
    static org.apache.camel.Predicate
    or(org.apache.camel.Predicate left, org.apache.camel.Predicate right)
    A helper method to combine two predicates by a logical OR.
    static org.apache.camel.Predicate
    regex(org.apache.camel.Expression expression, String regex)
    Returns a predicate which is true if the expression matches the given regular expression
    static org.apache.camel.Predicate
    regex(org.apache.camel.Expression expression, Pattern pattern)
    Returns a predicate which is true if the expression matches the given regular expression
    static org.apache.camel.Predicate
    startsWith(org.apache.camel.Expression left, org.apache.camel.Expression right)
     
    static org.apache.camel.Predicate
    toPredicate(org.apache.camel.Expression 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
  • Constructor Details

    • PredicateBuilder

      public PredicateBuilder()
  • Method Details

    • toPredicate

      public static org.apache.camel.Predicate toPredicate(org.apache.camel.Expression expression)
      Converts the given expression into an Predicate
    • not

      public static org.apache.camel.Predicate not(org.apache.camel.Predicate predicate)
      A helper method to return the logical not of the given predicate
    • and

      public static org.apache.camel.Predicate and(org.apache.camel.Predicate left, org.apache.camel.Predicate right)
      A helper method to combine multiple predicates by a logical AND
    • or

      public static org.apache.camel.Predicate or(org.apache.camel.Predicate left, org.apache.camel.Predicate right)
      A helper method to combine two predicates by a logical OR. If you want to combine multiple predicates see in(Predicate...)
    • or

      public static org.apache.camel.Predicate or(List<org.apache.camel.Predicate> predicates)
      Concat the given predicates into a single predicate, which matches if at least one predicates matches.
      Parameters:
      predicates - predicates
      Returns:
      a single predicate containing all the predicates
    • or

      public static org.apache.camel.Predicate or(org.apache.camel.Predicate... predicates)
      Concat the given predicates into a single predicate, which matches if at least one predicates matches.
      Parameters:
      predicates - predicates
      Returns:
      a single predicate containing all the predicates
    • in

      public static org.apache.camel.Predicate in(org.apache.camel.Predicate... predicates)
      A helper method to return true if any of the predicates matches.
    • in

      public static org.apache.camel.Predicate in(List<org.apache.camel.Predicate> predicates)
      A helper method to return true if any of the predicates matches.
    • isEqualTo

      public static org.apache.camel.Predicate isEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isEqualToIgnoreCase

      public static org.apache.camel.Predicate isEqualToIgnoreCase(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isNotEqualTo

      public static org.apache.camel.Predicate isNotEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isLessThan

      public static org.apache.camel.Predicate isLessThan(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isLessThanOrEqualTo

      public static org.apache.camel.Predicate isLessThanOrEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isGreaterThan

      public static org.apache.camel.Predicate isGreaterThan(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isGreaterThanOrEqualTo

      public static org.apache.camel.Predicate isGreaterThanOrEqualTo(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • contains

      public static org.apache.camel.Predicate contains(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • containsIgnoreCase

      public static org.apache.camel.Predicate containsIgnoreCase(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • isNull

      public static org.apache.camel.Predicate isNull(org.apache.camel.Expression expression)
    • isNotNull

      public static org.apache.camel.Predicate isNotNull(org.apache.camel.Expression expression)
    • isInstanceOf

      public static org.apache.camel.Predicate isInstanceOf(org.apache.camel.Expression expression, Class<?> type)
    • startsWith

      public static org.apache.camel.Predicate startsWith(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • endsWith

      public static org.apache.camel.Predicate endsWith(org.apache.camel.Expression left, org.apache.camel.Expression right)
    • regex

      public static org.apache.camel.Predicate regex(org.apache.camel.Expression 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 org.apache.camel.Predicate regex(org.apache.camel.Expression 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
    • and

      public static org.apache.camel.Predicate and(List<org.apache.camel.Predicate> predicates)
      Concat the given predicates into a single predicate, which only matches if all the predicates matches.
      Parameters:
      predicates - predicates
      Returns:
      a single predicate containing all the predicates
    • and

      public static org.apache.camel.Predicate and(org.apache.camel.Predicate... predicates)
      Concat the given predicates into a single predicate, which only matches if all the predicates matches.
      Parameters:
      predicates - predicates
      Returns:
      a single predicate containing all the predicates
    • constant

      public static org.apache.camel.Predicate constant(boolean answer)
      A constant predicate.
      Parameters:
      answer - the constant matches
      Returns:
      a predicate that always returns the given answer.