You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Pasquale Congiusti (Jira)" <ji...@apache.org> on 2026/01/27 10:16:00 UTC

[jira] [Updated] (CAMEL-22910) [camel-api] Exchange getPropertyAsList, getPropertyAsMap, ...

     [ https://issues.apache.org/jira/browse/CAMEL-22910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pasquale Congiusti updated CAMEL-22910:
---------------------------------------
    Fix Version/s: 4.18.0

> [camel-api] Exchange getPropertyAsList, getPropertyAsMap, ...
> -------------------------------------------------------------
>
>                 Key: CAMEL-22910
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22910
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Pasquale Congiusti
>            Assignee: Pasquale Congiusti
>            Priority: Minor
>             Fix For: 4.18.0
>
>
> The exchange is often used to get properties or variable. The method signature is like:
> {code}
> <T> T getProperty(String name, Class<T> type);
> {code}
> This is a bit of a runtime potential problem when, as a user, you want to extract a Collection of elements as you need to enforce a rawtype. We can work some additional method which are leveraging the existing implementation to expose a new method like for example:
> {code}
> <T> Collection<T> getPropertyAsCollection(String name, Class<T> elementType)
> {code}
> which internally does all the checks to validate and return a coherent Collection (and any other useful implementations we can think of), freeing the user to cast to a raw type.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)