Package org.cloudburstmc.server.utils
Class Config
java.lang.Object
org.cloudburstmc.server.utils.Config
- Direct Known Subclasses:
PluginConfig
author: MagicDroidX
Nukkit
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfig()Constructor for Config (YAML) instance with undefined file objectConfig(int type)Constructor for Config instance with undefined file objectConfig(File file, int type, LinkedHashMap<String,Object> defaultMap)Deprecated.Config(File file, int type, ConfigSection defaultMap)Config(String file, int type, LinkedHashMap<String,Object> defaultMap)Deprecated.Config(String file, int type, ConfigSection defaultMap) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck()booleanboolean<T> TgetAll()booleangetBoolean(String key)booleangetBoolean(String key, boolean defaultValue)getBooleanList(String key)getByteList(String key)getCharacterList(String key)doubledoublegetDoubleList(String key)getFloatList(String key)intintgetIntegerList(String key)getKeys()getKeys(boolean child)<T> List<T><T> List<T>longlonggetLongList(String key)getMapList(String key)Deprecated.<T> TDeprecated.useget(String, Object)instead<T> TgetNestedAs(String key, Class<T> type)Deprecated.useget(String)insteadGet root (main) config section of the ConfiggetSection(String key)getSections(String key)getShortList(String key)getStringList(String key)booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanload(InputStream inputStream)booleanbooleanbooleanload(String file, int type, ConfigSection defaultMap)voidreload()voidvoidremoveNested(String key)Deprecated.useremove(String)insteadbooleansave()booleanbooleanSave configuration into provided file.booleanvoidvoidsetAll(LinkedHashMap<String,Object> map)voidsetAll(ConfigSection section)intsetDefault(LinkedHashMap<String,Object> map)intsetDefault(ConfigSection map)
-
Field Details
-
DETECT
public static final int DETECT- See Also:
- Constant Field Values
-
PROPERTIES
public static final int PROPERTIES- See Also:
- Constant Field Values
-
CNF
public static final int CNF- See Also:
- Constant Field Values
-
JSON
public static final int JSON- See Also:
- Constant Field Values
-
YAML
public static final int YAML- See Also:
- Constant Field Values
-
ENUM
public static final int ENUM- See Also:
- Constant Field Values
-
ENUMERATION
public static final int ENUMERATION- See Also:
- Constant Field Values
-
format
-
-
Constructor Details
-
Config
public Config(int type)Constructor for Config instance with undefined file object- Parameters:
type- - Config type
-
Config
public Config()Constructor for Config (YAML) instance with undefined file object -
Config
-
Config
-
Config
-
Config
-
Config
Deprecated. -
Config
-
Config
-
Config
Deprecated.
-
-
Method Details
-
reload
public void reload() -
load
-
load
-
load
-
load
-
check
public boolean check() -
isCorrect
public boolean isCorrect() -
save
Save configuration into provided file. Internal file object will be set to new file.- Parameters:
file-async-- Returns:
-
save
-
save
public boolean save() -
save
-
set
-
get
-
get
-
getSection
-
isSection
-
getSections
-
getSections
-
getInt
-
getInt
-
isInt
-
getLong
-
getLong
-
isLong
-
getDouble
-
getDouble
-
isDouble
-
getString
-
getString
-
isString
-
getBoolean
-
getBoolean
-
isBoolean
-
getList
-
getList
-
isList
-
getStringList
-
getIntegerList
-
getBooleanList
-
getDoubleList
-
getFloatList
-
getLongList
-
getByteList
-
getCharacterList
-
getShortList
-
getMapList
-
setAll
-
setAll
-
exists
-
exists
-
remove
-
getAll
-
getRootSection
Get root (main) config section of the Config- Returns:
-
setDefault
-
setDefault
-
getNested
Deprecated.useget(String)instead -
getNested
Deprecated.useget(String, Object)instead -
getNestedAs
Deprecated.useget(String)instead -
removeNested
Deprecated.useremove(String)instead -
getKeys
-
getKeys
-
get(String)instead