JAL-3484 temporary override of autocalc preferences for project load
[jalview.git] / src / jalview / bin / Cache.java
index febc107..318b857 100755 (executable)
@@ -42,7 +42,9 @@ import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.TreeSet;
@@ -575,6 +577,25 @@ public class Cache
   {
     return applicationProperties.getProperty(key);
   }
+
+  /**
+   * A convenience method that returns a map holding property values for the
+   * specified keys. A null entry in the map indicates a property that is either
+   * not set, or set with value null.
+   * 
+   * @param key
+   * @return
+   */
+  public static Map<String, String> getProperties(String... key)
+  {
+    Map<String, String> map = new HashMap<>();
+    for (String k : key)
+    {
+      map.put(k, getProperty(k));
+    }
+    return map;
+  }
+
   /**
    * These methods are used when checking if the saved preference is different
    * to the default setting