commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject [collections] New MapUtils Method?
Date Thu, 07 Aug 2008 13:36:31 GMT
What do you folks think about adding a new method like this to MapUtils?

public void <K1,K2,V> fillTransitiveMap(Map<K1,K2> keysMap, Map<K2,V>
valuesMap, Map<K,V> result)
  for (K1 key1 : keysMap.keySet())
    K2 key2 = keysMap.get(key1);
    V value = valuesMap.get(key2);
    resultMap.put(key1, value);

I don't know about the name, but basically it just bridges the gap
between two maps.  We had a use for this at work today and I thought
it might be something generally useful.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message