[
https://issues.apache.org/jira/browse/CAMEL-22910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pasquale Congiusti updated CAMEL-22910:
---------------------------------------
Affects Version/s: 4.x
> [camel-api] Exchange getPropertyAsList, getPropertyAsMap, ...
> -------------------------------------------------------------
>
> Key: CAMEL-22910
> URL: https://issues.apache.org/jira/browse/CAMEL-22910
> Project: Camel
> Issue Type: New Feature
> Affects Versions: 4.x
> 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)