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


##########
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
+     * @return the updated collector
+     */
+    public static <K, V, M extends MultiValuedMap<K, V>>
+    M invertInto(MultiValuedMap<? extends V, ? extends K> source, M collector) 
{

Review Comment:
   Maybe invertMerge would better describe what the method does?
   
   Also rather than source and dest, would input and output be clearer?
   
   I don't like the abbreviation 'dest'; it's best to spell names in full as 
not all users will have English as a first language.



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