blob: 22aaf1afd046a99838afd43f26316a2dc800dd3b [file] [log] [blame] [raw]
/* Copyright 2015-2020 Rivoreo
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package rivoreo.config;
import java.io.IOException;
import java.util.Map;
public interface Configuration {
public boolean get_boolean(String key, boolean default_value);
public int get_int(String key, int default_value);
public long get_long(String key, long default_value);
public float get_float(String key, float default_value);
public double get_double(String key, double default_value);
public String get_string(String key, String default_value);
public Configuration get_child(String key, boolean create_if_nonexist);
public boolean[] get_boolean_list(String key, boolean[] default_value);
public int[] get_int_list(String key, int[] default_value);
public long[] get_long_list(String key, long[] default_value);
public float[] get_float_list(String key, float[] default_value);
public double[] get_double_list(String key, double[] default_value);
public String[] get_string_list(String key, String[] default_value);
public <T> Map<String, T> get_all(Class<T> type);
public void set(String key, boolean value);
public void set(String key, int value);
public void set(String key, long value);
public void set(String key, float value);
public void set(String key, double value);
public void set(String key, String value);
public void set(String key, Configuration value);
public void save() throws IOException;
}