You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "James Strachan (JIRA)" <ji...@apache.org> on 2008/03/27 16:58:32 UTC
[jira] Resolved: (CAMEL-401) header().contains() could have natural
specialisation for String arguments
[ https://issues.apache.org/activemq/browse/CAMEL-401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Strachan resolved CAMEL-401.
----------------------------------
Fix Version/s: 1.3.0
Resolution: Fixed
Patch applied with thanks!
> 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
> Fix For: 1.3.0
>
> Attachments: camel-401.patch
>
>
> 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.