You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Mogley (JIRA)" <ji...@apache.org> on 2011/07/20 21:06:58 UTC

[jira] [Commented] (COLLECTIONS-333) Generic versions of Transformed* classes

    [ https://issues.apache.org/jira/browse/COLLECTIONS-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068568#comment-13068568 ] 

Michael Mogley commented on COLLECTIONS-333:
--------------------------------------------

Actually, I was going to raise an issue to have Transformer be made generic. It should not be difficult to parametrize this interface using both a source and target type, along the lines of Transformer<S,T>.  The transform method would then become: 

T transform(S source)

The corresponding transformer classes could be parametrized in a similar way.

> Generic versions of Transformed* classes
> ----------------------------------------
>
>                 Key: COLLECTIONS-333
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-333
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Bag, Collection, List, Set
>    Affects Versions: 3.2
>         Environment: OS X
>            Reporter: Edwin Tellman
>            Assignee: Stephen Kestle
>            Priority: Minor
>             Fix For: 4.0-beta-1
>
>
> The generic version of Transformer required the input and output types to be identical.  This seemed to me to reduce the usefulness of transformed collections, as transforming one type into another seems like it would be a fairly common operation.  I'm not sure how to fix this, however, as it also doesn't seem feasible to have a generic TransformedCollection with different input and output types that implements Collection<E>.  Anyway, this patch de-generifies TransformedCollection, which also fixes some compilation problems.  Please disregard this change if you disagree and have a better solution.
> Cloned from COLLECTIONS-243, where there is much Transformed* discussion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira