Pasquale Congiusti created CAMEL-22910:
------------------------------------------

             Summary: [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


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)

Reply via email to