X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fbin%2FCache.java;h=318b857a22a6fe01d0d9eb599dbb2bbd27229ec5;hb=21fcce633c77a700ee488806f60b5e4dc8f6895b;hp=febc107796ed28d74e2a6f526851851fee35fac1;hpb=b5889c572976c81f068d9743363695ca84e7d413;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index febc107..318b857 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -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 getProperties(String... key) + { + Map 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