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

Nicolas Filotto commented on CAMEL-17918:
-----------------------------------------

The corresponding PR [https://github.com/apache/camel/pull/7382] which adds a 
new element called _{{headersNameProvider}}_ to the annotation 
_{{UriEndpoint}}_ in order to be able to provide the name of the field to get 
or the name of the method to invoke to get the name of the header

> Define the header name provider in case the headers class is an enum
> --------------------------------------------------------------------
>
>                 Key: CAMEL-17918
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17918
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Nicolas Filotto
>            Assignee: Nicolas Filotto
>            Priority: Minor
>             Fix For: 3.17.0
>
>
> 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".
>  
> {noformat}
> public enum SomeEnum {
>     FOO("fooKey"),
>     BAR("barKey");
>     public final String headerName;
>  
>     SomeEnum(final String str) {
>         this.headerName = str;
>     }
> }{noformat}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to