/** * Creates an inverted mapping of the key/value pairs in the given map. * * @param pSource the source map * @return a new {@code Map} of same type as {@code pSource} * @throws IllegalArgumentException if {@code pSource == null}, * or if a new map can't be instantiated, * or if source map contains duplicates. * * @see #invert(java.util.Map, java.util.Map, DuplicateHandler) */ public static <K, V> Map<V, K> invert(Map<K, V> pSource) { return invert(pSource, null, null); }
/** * Creates an inverted mapping of the key/value pairs in the given map. * * @param pSource the source map * @return a new {@code Map} of same type as {@code pSource} * @throws IllegalArgumentException if {@code pSource == null}, * or if a new map can't be instantiated, * or if source map contains duplaicates. * * @see #invert(java.util.Map, java.util.Map, DuplicateHandler) */ public static <K, V> Map<V, K> invert(Map<K, V> pSource) { return invert(pSource, null, null); }
/** * Creates an inverted mapping of the key/value pairs in the given map. * * @param pSource the source map * @return a new {@code Map} of same type as {@code pSource} * @throws IllegalArgumentException if {@code pSource == null}, * or if a new map can't be instantiated, * or if source map contains duplicates. * * @see #invert(java.util.Map, java.util.Map, DuplicateHandler) */ public static <K, V> Map<V, K> invert(Map<K, V> pSource) { return invert(pSource, null, null); }
/** * Creates an inverted mapping of the key/value pairs in the given map. * * @param pSource the source map * @return a new {@code Map} of same type as {@code pSource} * @throws IllegalArgumentException if {@code pSource == null}, * or if a new map can't be instantiated, * or if source map contains duplicates. * * @see #invert(java.util.Map, java.util.Map, DuplicateHandler) */ public static <K, V> Map<V, K> invert(Map<K, V> pSource) { return invert(pSource, null, null); }