12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- // Settings
- //
- // Douglas Thrift
- //
- // Settings.java
- /* Copyright 2011 Douglas Thrift
- *
- * This file is part of Big Screen Bot.
- *
- * Big Screen Bot is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Big Screen Bot is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Big Screen Bot. If not, see <http://www.gnu.org/licenses/>.
- */
- package net.douglasthrift.bigscreenbot;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Properties;
- public class Settings extends Properties
- {
- public boolean getBooleanProperty(String key, boolean defaultValue)
- {
- String value = getProperty(key);
- if (value != null)
- return Boolean.parseBoolean(value);
- else
- return defaultValue;
- }
- public int getIntegerProperty(String key, int defaultValue)
- {
- String value = getProperty(key);
- if (value != null)
- return Integer.parseInt(value);
- else
- return defaultValue;
- }
- public List<String> getListProperty(String key)
- {
- String value = getProperty(key);
- if (value != null)
- return Arrays.asList(value.split("\\s"));
- else
- return null;
- }
- }
- // vim: expandtab
|