[ 
https://issues.apache.org/activemq/browse/CAMEL-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41835#action_41835
 ] 

Gary Tully commented on CAMEL-401:
----------------------------------

on the patch, I figured a single String can be considered as a collection of 
characters so collection-contains behaviour is maintained.

Thanks for the feedback.

> 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
>         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.

Reply via email to