Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-401

header().contains() could have natural specialisation for String arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.3.0
    • camel-core
    • None

    Description

      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.

      Attachments

        1. camel-401.patch
          3 kB
          Gary Tully

        Activity

          People

            Unassigned Unassigned
            gtully Gary Tully
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: