Skip to content

Commit 11d25cb

Browse files
committed
Adds getBooleanSetting function.
1 parent f768d59 commit 11d25cb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/configuration/Settings.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,22 @@ public void loadFromFile() throws IOException, ParseException {
164164
validateSettings();
165165
}
166166

167+
/**
168+
* Retrieves a setting as a boolean.
169+
*
170+
* @param setting
171+
* The setting.
172+
*
173+
* @return
174+
* The value.
175+
*
176+
* @throws NumberFormatException
177+
* If the setting string doesn't contain a parsable boolean.
178+
*/
179+
public boolean getBooleanSetting(final @NonNull String setting) {
180+
return Boolean.valueOf(settings.get(setting));
181+
}
182+
167183
/**
168184
* Retrieves a setting as a byte.
169185
*

0 commit comments

Comments
 (0)