camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAMEL-401) header().contains() could have natural specialisation for String arguments
Date Wed, 26 Mar 2008 21:51:33 GMT
header().contains() could have natural specialisation for String arguments
--------------------------------------------------------------------------

                 Key: CAMEL-401
                 URL: https://issues.apache.org/activemq/browse/CAMEL-401
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 1.2.0
            Reporter: Gary Tully



Filtering on a header that contains a string with a hyphen, the following works:

from(file://temp).filter(header(FileComponent.HEADER_FILE_NAME).matchesRegex(".*-.*")).to("mock:result");

but contains is more natural and should also work. 

from(file://temp).filter(header(FileComponent.HEADER_FILE_NAME).contains("-")).to("mock:result");

It does not as contains() is focused on collections and reduces to checking equality on single
values. A string specialisation could use string.contains.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message