public class Config extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CNF |
static int |
DETECT |
static int |
ENUM |
static int |
ENUMERATION |
static Map<String,Integer> |
format |
static int |
JSON |
static int |
PROPERTIES |
static int |
YAML |
| Constructor and Description |
|---|
Config()
Constructor for Config (YAML) instance with undefined file object
|
Config(File file) |
Config(File file,
int type) |
Config(File file,
int type,
ConfigSection defaultMap) |
Config(File file,
int type,
LinkedHashMap<String,Object> defaultMap)
Deprecated.
|
Config(int type)
Constructor for Config instance with undefined file object
|
Config(String file) |
Config(String file,
int type) |
Config(String file,
int type,
ConfigSection defaultMap) |
Config(String file,
int type,
LinkedHashMap<String,Object> defaultMap)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
check() |
boolean |
exists(String key) |
boolean |
exists(String key,
boolean ignoreCase) |
Object |
get(String key) |
<T> T |
get(String key,
T defaultValue) |
Map<String,Object> |
getAll() |
boolean |
getBoolean(String key) |
boolean |
getBoolean(String key,
boolean defaultValue) |
List<Boolean> |
getBooleanList(String key) |
List<Byte> |
getByteList(String key) |
List<Character> |
getCharacterList(String key) |
double |
getDouble(String key) |
double |
getDouble(String key,
double defaultValue) |
List<Double> |
getDoubleList(String key) |
List<Float> |
getFloatList(String key) |
int |
getInt(String key) |
int |
getInt(String key,
int defaultValue) |
List<Integer> |
getIntegerList(String key) |
Set<String> |
getKeys() |
Set<String> |
getKeys(boolean child) |
<T> List<T> |
getList(String key) |
<T> List<T> |
getList(String key,
List<T> defaultList) |
long |
getLong(String key) |
long |
getLong(String key,
long defaultValue) |
List<Long> |
getLongList(String key) |
List<Map> |
getMapList(String key) |
Object |
getNested(String key)
Deprecated.
use
get(String) instead |
<T> T |
getNested(String key,
T defaultValue)
Deprecated.
use
get(String, Object) instead |
<T> T |
getNestedAs(String key,
Class<T> type)
Deprecated.
use
get(String) instead |
ConfigSection |
getRootSection()
Get root (main) config section of the Config
|
ConfigSection |
getSection(String key) |
ConfigSection |
getSections() |
ConfigSection |
getSections(String key) |
List<Short> |
getShortList(String key) |
String |
getString(String key) |
String |
getString(String key,
String defaultValue) |
List<String> |
getStringList(String key) |
boolean |
isBoolean(String key) |
boolean |
isCorrect() |
boolean |
isDouble(String key) |
boolean |
isInt(String key) |
boolean |
isList(String key) |
boolean |
isLong(String key) |
boolean |
isSection(String key) |
boolean |
isString(String key) |
boolean |
load(InputStream inputStream) |
boolean |
load(String file) |
boolean |
load(String file,
int type) |
boolean |
load(String file,
int type,
ConfigSection defaultMap) |
void |
reload() |
void |
remove(String key) |
void |
removeNested(String key)
Deprecated.
use
remove(String) instead |
boolean |
save() |
boolean |
save(Boolean async) |
boolean |
save(File file) |
boolean |
save(File file,
boolean async)
Save configuration into provided file.
|
void |
set(String key,
Object value) |
void |
setAll(ConfigSection section) |
void |
setAll(LinkedHashMap<String,Object> map) |
int |
setDefault(ConfigSection map) |
int |
setDefault(LinkedHashMap<String,Object> map) |
public static final int DETECT
public static final int PROPERTIES
public static final int CNF
public static final int JSON
public static final int YAML
public static final int ENUM
public static final int ENUMERATION
public Config(int type)
type - - Config typepublic Config()
public Config(String file)
public Config(File file)
public Config(String file, int type)
public Config(File file, int type)
@Deprecated public Config(String file, int type, LinkedHashMap<String,Object> defaultMap)
public Config(String file, int type, ConfigSection defaultMap)
public Config(File file, int type, ConfigSection defaultMap)
@Deprecated public Config(File file, int type, LinkedHashMap<String,Object> defaultMap)
public void reload()
public boolean load(String file)
public boolean load(String file, int type)
public boolean load(String file, int type, ConfigSection defaultMap)
public boolean load(InputStream inputStream)
public boolean check()
public boolean isCorrect()
public boolean save(File file, boolean async)
file - async - public boolean save(File file)
public boolean save()
public boolean save(Boolean async)
public <T> T get(String key, T defaultValue)
public ConfigSection getSection(String key)
public boolean isSection(String key)
public ConfigSection getSections(String key)
public ConfigSection getSections()
public int getInt(String key)
public int getInt(String key, int defaultValue)
public boolean isInt(String key)
public long getLong(String key)
public long getLong(String key, long defaultValue)
public boolean isLong(String key)
public double getDouble(String key)
public double getDouble(String key, double defaultValue)
public boolean isDouble(String key)
public boolean isString(String key)
public boolean getBoolean(String key)
public boolean getBoolean(String key, boolean defaultValue)
public boolean isBoolean(String key)
public boolean isList(String key)
public void setAll(LinkedHashMap<String,Object> map)
public void setAll(ConfigSection section)
public boolean exists(String key)
public boolean exists(String key, boolean ignoreCase)
public void remove(String key)
public ConfigSection getRootSection()
public int setDefault(LinkedHashMap<String,Object> map)
public int setDefault(ConfigSection map)
@Deprecated public Object getNested(String key)
get(String) instead@Deprecated public <T> T getNested(String key, T defaultValue)
get(String, Object) instead@Deprecated public <T> T getNestedAs(String key, Class<T> type)
get(String) instead@Deprecated public void removeNested(String key)
remove(String) insteadCopyright © 2020. All rights reserved.