You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Luca Burgazzoli (Jira)" <ji...@apache.org> on 2021/04/09 13:21:00 UTC

[jira] [Updated] (CAMEL-16477) ProcessorDefinitionHelper: ruturn a collection instead of an iterator for filterTypeInOutputs methods

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

Luca Burgazzoli updated CAMEL-16477:
------------------------------------
    Description: 
The ProcessorDefinitionHelper define methods like:

{code:java}
Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type)
Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type, int maxDeep)
{code}

Internally those methods are based on Lists but the return is always an iterator which make processing the result a little verbose.

We could instead return an immutable Collection


  was:
The ProcessorDefinitionHelper define methods like:

    Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type)
    Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type, int maxDeep)

Internally those methods are based on Lists but the return is always an iterator which make processing the result a little verbose.

We could instead return an immutable Collection



> ProcessorDefinitionHelper: ruturn a collection instead of an iterator for filterTypeInOutputs methods
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16477
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16477
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>
> The ProcessorDefinitionHelper define methods like:
> {code:java}
> Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type)
> Iterator<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type, int maxDeep)
> {code}
> Internally those methods are based on Lists but the return is always an iterator which make processing the result a little verbose.
> We could instead return an immutable Collection



--
This message was sent by Atlassian Jira
(v8.3.4#803005)