You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicolas Filotto (Jira)" <ji...@apache.org> on 2022/04/07 12:46:00 UTC
[jira] [Resolved] (CAMEL-17918) Define the header name provider in case the headers class is an enum
[ https://issues.apache.org/jira/browse/CAMEL-17918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Filotto resolved CAMEL-17918.
-------------------------------------
Resolution: Fixed
> 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)