]> gitweb.fperrin.net Git - DictionaryPC.git/commitdiff
Remove unused functions that cause warnings.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 11 Apr 2020 22:50:09 +0000 (00:50 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 11 Apr 2020 22:50:09 +0000 (00:50 +0200)
src/com/hughes/util/MapUtil.java

index a62a86ec0e557acbd11df56b854995898d015552..0976288f631e3057e349c8e1c2c0beed6a0b5f19 100644 (file)
@@ -16,40 +16,11 @@ package com.hughes.util;
 
 import java.util.Map;
 
-@SuppressWarnings({"WeakerAccess", "unused"})
 public class MapUtil {
-
-    public static <K,V> V safeGet(final Map<K,V> map, K key, V defaultValue) {
-        if (!map.containsKey(key)) {
-            return defaultValue;
-        }
-        return map.get(key);
-    }
-
-    public static <K,V> V safeGetOrPut(final Map<K,V> map, K key, V defaultValue) {
-        if (!map.containsKey(key)) {
-            map.put(key, defaultValue);
-        }
-        return map.get(key);
-    }
-
-    public static <K,V> V safeGet(final Map<K,V> map, K key, Class<V> valueClass) {
-        if (!map.containsKey(key)) {
-            try {
-                map.put(key, valueClass.newInstance());
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-        return map.get(key);
-    }
-
     public static <K,V> V safeRemove(final Map<K,V> map, K key, V defaultValue) {
         if (!map.containsKey(key)) {
             return defaultValue;
         }
         return map.remove(key);
     }
-
-
 }