sebbASF commented on code in PR #665:
URL:
https://github.com/apache/commons-collections/pull/665#discussion_r2618587063
##########
src/main/java/org/apache/commons/collections4/MultiValuedMap.java:
##########
@@ -140,6 +140,17 @@ public interface MultiValuedMap<K, V> {
*/
Collection<V> get(K key);
+ /**
+ * Returns the inverse MultiValuedMap with inverted mappings.
Review Comment:
'the' => 'a new'
'the' implies that there is only one such map
##########
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 dest add value-to-key mappings here
+ * @param <K> the dest key type
+ * @param <V> the dest value type
+ * @param <M> the dest multimap
+ * @return the destination
Review Comment:
This does not make sense to me. What is the destination?
I think the Javadoc needs to make clear that the method creates a new map
with the inverted keys
--
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]