]> source.dussan.org Git - gitblit.git/commitdiff
Add a method to test for the existence of a setting
authorJames Moger <james.moger@gitblit.com>
Thu, 27 Mar 2014 13:01:28 +0000 (09:01 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 27 Mar 2014 13:01:28 +0000 (09:01 -0400)
src/main/java/com/gitblit/IStoredSettings.java

index 9c7a2d23689a50d612c450b4f460797a45c59ef1..13dca6b61ed78647cc2c5107cce30ede676167d6 100644 (file)
@@ -342,6 +342,16 @@ public abstract class IStoredSettings {
                overrides.put(key, "" + value);\r
        }\r
 \r
+       /**\r
+        * Tests for the existence of a setting.\r
+        *\r
+        * @param key\r
+        * @return true if the setting exists\r
+        */\r
+       public boolean hasSettings(String key) {\r
+               return getString(key, null) != null;\r
+       }\r
+\r
        /**\r
         * Updates the values for the specified keys and persists the entire\r
         * configuration file.\r