You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/04/14 08:32:43 UTC

DO NOT REPLY [Bug 34446] New: - [collection] Map filter with MapUtils.predicatedMap feature request

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34446>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34446

           Summary: [collection] Map filter with MapUtils.predicatedMap
                    feature request
           Product: Commons
           Version: 3.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Luc.Carpentier@uniway.be


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...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org