activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r539516 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
Date Fri, 18 May 2007 16:39:03 GMT
Author: jstrachan
Date: Fri May 18 09:39:02 2007
New Revision: 539516

URL: http://svn.apache.org/viewvc?view=rev&rev=539516
Log:
added contains() method to the DSL for .header("foo").contains("cheese") for multi-value headers

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java?view=diff&rev=539516&r1=539515&r2=539516
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
Fri May 18 09:39:02 2007
@@ -105,6 +105,20 @@
     }
 
     /**
+     * Create a predicate that the left hand expression contains the value of the right hand
expression
+     *
+     * @param value the element which is compared to be contained within this expression
+     * @return a predicate which evaluates to true if the given value expression is contained
within this
+     * expression value
+     */
+    @Fluent
+    public Predicate<E> contains(@FluentArg("value")Object value) {
+        Expression<E> right = asExpression(value);
+        return onNewPredicate(PredicateBuilder.contains(expression, right));
+    }
+
+
+    /**
      * Creates a predicate which is true if this expression matches the given regular expression
      *
      * @param regex the regular expression to match



Mime
View raw message