commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anirudh Vyas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COLLECTIONS-88) [collection] Map filter with MapUtils.predicatedMap feature request
Date Tue, 03 May 2011 00:38:03 GMT

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

Anirudh Vyas commented on COLLECTIONS-88:
-----------------------------------------

I would like to commit this feature if permitted, please provide me with the instructions,
your formatting standards etc link and I'll be happy to help you guys out.

> [collection] Map filter with MapUtils.predicatedMap feature request
> -------------------------------------------------------------------
>
>                 Key: COLLECTIONS-88
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-88
>             Project: Commons Collections
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Luc Carpentier
>
> Hello,
> I stumbled into the following problem:
> A client submits an http request with prefixed parameters. Each prefix will 
> have it's own javabean to populate. So if there are two prefixes, then there 
> will be two different javabeans to populate from the request parameters.
> I created a PrefixPredicate that only allows values with a specific prefix. I 
> then used this PrefixPredicate to copy the Map with the request parameters to 
> a predicated Map with:
> Map predicatedMap = MapUtils.predicatedMap(dataMap,keyPredicate,null);
> However, since the request parameters contain parameters with other prefixes 
> as well, this returns an IllegalArgumentException.
> It would be nice to be able to specify to the MapUtils.predicatedMap method to 
> ignore entries that do not comply to the predicate instead of to throw an 
> exception.
> There are lots of possabilities to filter on a Collection, but a Map is not a 
> collection...

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

Mime
View raw message