-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
None
Consider something like
<K1,V1> Map<K1,V1> transform(Function<K,K1> keyFunc, Function<V,V1> valueFunc)
This creates a new Map and populates it with the result of calling keyFunc, valueFunc on all entries
of the current map. This differs from Map.replaceAll() which modifies the map in-place and which is
constrained to keep the same key and value types.
Probably need overloads with a Map supplier and with a merging function, in case values end up being mapped
to the same key in the destination.
<K1,V1> Map<K1,V1> transform(Function<K,K1> keyFunc, Function<V,V1> valueFunc)
This creates a new Map and populates it with the result of calling keyFunc, valueFunc on all entries
of the current map. This differs from Map.replaceAll() which modifies the map in-place and which is
constrained to keep the same key and value types.
Probably need overloads with a Map supplier and with a merging function, in case values end up being mapped
to the same key in the destination.