JAL-2826 added action performed for hiding collapsed sequences
[jalview.git] / src / jalview / util / MappingUtils.java
index 9c5c109..78a833e 100644 (file)
@@ -990,4 +990,23 @@ public final class MappingUtils
       }
     }
   }
+
+
+  public static <K, V> Map<K, V> putWithDuplicationCheck(Map<K, V> map, K key,
+          V value)
+  {
+    if (!map.containsKey(key))
+    {
+      map.put(key, value);
+    }
+    else
+    {
+      jalview.bin.Cache.log.warn(
+              "Attempt to add duplicate entry detected for map with key: "
+                      + key.toString() + " and value: " + value.toString());
+    }
+  
+    return map;
+    
+  }
 }