sebbASF commented on code in PR #665:
URL: 
https://github.com/apache/commons-collections/pull/665#discussion_r2619784014


##########
src/main/java/org/apache/commons/collections4/MultiMapUtils.java:
##########
@@ -170,6 +171,27 @@ public static boolean isEmpty(final MultiValuedMap<?, ?> 
map) {
         return map == null || map.isEmpty();
     }
 
+    /**
+     * A utility method to invert the mappings from a source MultiValuedMap

Review Comment:
   Does it have to be a MultiValuedMap? Would an ordinary Map be OK?



##########
src/main/java/org/apache/commons/collections4/MultiMapUtils.java:
##########
@@ -170,6 +171,27 @@ public static boolean isEmpty(final MultiValuedMap<?, ?> 
map) {
         return map == null || map.isEmpty();
     }
 
+    /**
+     * A utility method to invert the mappings from a source MultiValuedMap
+     * to a collector MultiValuedMap. If you are trying to create an
+     * inverse multimap of the same kind as the original, consider using
+     * {@link MultiValuedMap#inverted()}.
+     *
+     * @param source take key-to-value mappings from here
+     * @param collector add value-to-key mappings here
+     * @param <K> the collector key type
+     * @param <V> the collector value type
+     * @param <M> the collector multimap

Review Comment:
   What are the valid types for M? 
   Are all multimap types suitable?



##########
src/main/java/org/apache/commons/collections4/MultiMapUtils.java:
##########
@@ -170,6 +171,27 @@ public static boolean isEmpty(final MultiValuedMap<?, ?> 
map) {
         return map == null || map.isEmpty();
     }
 
+    /**
+     * A utility method to invert the mappings from a source MultiValuedMap
+     * to a collector MultiValuedMap. If you are trying to create an
+     * inverse multimap of the same kind as the original, consider using

Review Comment:
   'same kind' is ambiguous.
   
   AIUI, this method returns a MultiValuedMap; is that not the 'same kind' of 
map as the original?
   
   It's not clear when one should consider using #inverted()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to