[
https://issues.apache.org/jira/browse/COLLECTIONS-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13831423#comment-13831423
]
Josh Cain commented on COLLECTIONS-503:
---------------------------------------
[~tn], I can definitely just make this an addition to the SwitchTransformer. I
did have a question though - for the sake of consistency, would you like for me
to do this with the ifClosure/SwitchClosure as well? Seems as if we've got
duplicate functionality between the SwitchClosure and IfClosure in the same
way. If you don't want to remove the IfClosure (which I wouldn't recommend),
we could mark it as deprecated and wrap the SwitchClosure so that the core
functionality is maintained in a single location.
Anyway, just let me know what you want to do as far as keeping the two
consistent, if you are concerned with that. I'll wait to hear from you before
proceeding one way or the other.
> IfTransformer
> -------------
>
> Key: COLLECTIONS-503
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-503
> Project: Commons Collections
> Issue Type: New Feature
> Components: Functor
> Reporter: Josh Cain
> Priority: Trivial
> Fix For: 4.0.1
>
> Attachments: ifTransformer.patch
>
>
> Just thought a basic ifTransformer that performs operations based on a
> predicate would be useful. I know this functionality can be accomplished via
> a switchTransformer, but sometimes it would just be easier and more clear to
> have an ifTransformer.
> I attached a draft of what it could look like. Let me know if this is
> something that should be included and I can polish it and write some tests.
--
This message was sent by Atlassian JIRA
(v6.1#6144)