...
Operator | Description |
---|---|
== | equals |
=~ | Camel 2.16: equals ignore case (will ignore case when comparing String values) |
> | greater than |
>= | greater than or equals |
< | less than |
<= | less than or equals |
!= | not equals |
contains | For testing if contains in a string based value |
not contains | For testing if not contains in a string based value |
regex | For matching against a given regular expression pattern defined as a String value |
not regex | For not matching against a given regular expression pattern defined as a String value |
in | For matching if in a set of values, each element must be separated by comma. |
not in | For matching if not in a set of values, each element must be separated by comma. |
is | For matching if the left hand side type is an instanceof the value. |
not is | For matching if the left hand side type is not an instanceof the value. |
range | For matching if the left hand side is within a range of values defined as numbers: |
not range | For matching if the left hand side is not within a range of values defined as numbers: |
...
Code Block |
---|
${leftValue} OP rightValue or ${leftValue} OP rightValue |
Some examples:
Code Block |
---|
// exact equals match simple("${in.header.foo} == 'foo'") // ignore case when comparing, so if the header has value FOO this will match simple("${in.header.foo} =~ 'foo'") // here Camel will type convert '100' into the type of in.header.bar and if its an Integer '100' will also be converter to an Integer simple("${in.header.bar} == '100'") simple("${in.header.bar} == 100") // 100 will be converter to the type of in.header.bar so we can do > comparison simple("${in.header.bar} > 100") |
...
Suppose you have an enum for customers
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Customer.java} |
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/CBRSimpleTypeTest.java} |
Using new lines or tabs in XML DSLs
...