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

Define the header name provider in case the headers class is an enum

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.17.0
    • None
    • None
    • Unknown

    Description

      When the headers class is an enum, so far the name of the headers can only be the name of the values of the enum which is not enough in some particular use cases. The idea of this improvement is to be able to provide the name of the field or method to invoke in order to get the name of the corresponding header.

      In the next example, if the enum "SomeEnum" is declared as the headers class of a component, with the current code only "FOO" and "BAR" are possible values for the name of the headers while here we would rather expect "fooKey" and "barKey".

       

      public enum SomeEnum {
      
          FOO("fooKey"),
          BAR("barKey");
      
          public final String headerName;
       
          SomeEnum(final String str) {
              this.headerName = str;
          }
      }

       

       

      Attachments

        Issue Links

          Activity

            People

              essobedo Nicolas Filotto
              essobedo Nicolas Filotto
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: