Package dev.aura.bungeechat.config
Class Configuration
- java.lang.Object
-
- dev.aura.bungeechat.config.Configuration
-
- All Implemented Interfaces:
Config
,ConfigMergeable
public class Configuration extends Object implements Config
-
-
Field Summary
Fields Modifier and Type Field Description protected Config
config
protected static File
CONFIG_FILE
protected static String
CONFIG_FILE_NAME
protected static File
OLD_CONFIG_FILE
protected static String
OLD_CONFIG_FILE_NAME
protected static File
OLD_OLD_CONFIG_FILE
protected static String
OLD_OLD_CONFIG_FILE_NAME
protected static ConfigParseOptions
PARSE_OPTIONS
protected static ConfigRenderOptions
RENDER_OPTIONS
-
Constructor Summary
Constructors Modifier Constructor Description protected
Configuration()
-
Method Summary
-
-
-
Field Detail
-
PARSE_OPTIONS
protected static final ConfigParseOptions PARSE_OPTIONS
-
RENDER_OPTIONS
protected static final ConfigRenderOptions RENDER_OPTIONS
-
CONFIG_FILE_NAME
protected static final String CONFIG_FILE_NAME
- See Also:
- Constant Field Values
-
OLD_CONFIG_FILE_NAME
protected static final String OLD_CONFIG_FILE_NAME
- See Also:
- Constant Field Values
-
OLD_OLD_CONFIG_FILE_NAME
protected static final String OLD_OLD_CONFIG_FILE_NAME
- See Also:
- Constant Field Values
-
CONFIG_FILE
protected static final File CONFIG_FILE
-
OLD_CONFIG_FILE
protected static final File OLD_CONFIG_FILE
-
OLD_OLD_CONFIG_FILE
protected static final File OLD_OLD_CONFIG_FILE
-
config
protected Config config
-
-
Method Detail
-
load
public static Configuration load()
Creates and loads the config. Also saves it so that all missing values exist!
Also set currentConfig to this config.- Returns:
- a configuration object, loaded from the config file.
-
get
public static Configuration get()
-
loadConfig
protected void loadConfig()
-
saveConfig
protected void saveConfig()
-
getHeader
protected static String getHeader()
-
root
public ConfigObject root()
-
origin
public ConfigOrigin origin()
-
withFallback
public Config withFallback(ConfigMergeable arg0)
- Specified by:
withFallback
in interfaceConfig
- Specified by:
withFallback
in interfaceConfigMergeable
-
resolve
public Config resolve(ConfigResolveOptions arg0)
-
isResolved
public boolean isResolved()
- Specified by:
isResolved
in interfaceConfig
-
resolveWith
public Config resolveWith(Config arg0)
- Specified by:
resolveWith
in interfaceConfig
-
resolveWith
public Config resolveWith(Config arg0, ConfigResolveOptions arg1)
- Specified by:
resolveWith
in interfaceConfig
-
checkValid
public void checkValid(Config arg0, String... arg1)
- Specified by:
checkValid
in interfaceConfig
-
hasPathOrNull
public boolean hasPathOrNull(String arg0)
- Specified by:
hasPathOrNull
in interfaceConfig
-
entrySet
public Set<Map.Entry<String,ConfigValue>> entrySet()
-
getBoolean
public boolean getBoolean(String arg0)
- Specified by:
getBoolean
in interfaceConfig
-
getObject
public ConfigObject getObject(String arg0)
-
getValue
public ConfigValue getValue(String arg0)
-
getMemorySize
public ConfigMemorySize getMemorySize(String arg0)
- Specified by:
getMemorySize
in interfaceConfig
-
getMilliseconds
@Deprecated public Long getMilliseconds(String arg0)
Deprecated.- Specified by:
getMilliseconds
in interfaceConfig
-
getNanoseconds
@Deprecated public Long getNanoseconds(String arg0)
Deprecated.- Specified by:
getNanoseconds
in interfaceConfig
-
getDuration
public long getDuration(String arg0, TimeUnit arg1)
- Specified by:
getDuration
in interfaceConfig
-
getDuration
public Duration getDuration(String arg0)
- Specified by:
getDuration
in interfaceConfig
-
getTemporal
public TemporalAmount getTemporal(String arg0)
- Specified by:
getTemporal
in interfaceConfig
-
getList
public ConfigList getList(String arg0)
-
getBooleanList
public List<Boolean> getBooleanList(String arg0)
- Specified by:
getBooleanList
in interfaceConfig
-
getNumberList
public List<Number> getNumberList(String arg0)
- Specified by:
getNumberList
in interfaceConfig
-
getIntList
public List<Integer> getIntList(String arg0)
- Specified by:
getIntList
in interfaceConfig
-
getLongList
public List<Long> getLongList(String arg0)
- Specified by:
getLongList
in interfaceConfig
-
getDoubleList
public List<Double> getDoubleList(String arg0)
- Specified by:
getDoubleList
in interfaceConfig
-
getStringList
public List<String> getStringList(String arg0)
- Specified by:
getStringList
in interfaceConfig
-
getEnumList
public <T extends Enum<T>> List<T> getEnumList(Class<T> arg0, String arg1)
- Specified by:
getEnumList
in interfaceConfig
-
getObjectList
public List<? extends ConfigObject> getObjectList(String arg0)
- Specified by:
getObjectList
in interfaceConfig
-
getConfigList
public List<? extends Config> getConfigList(String arg0)
- Specified by:
getConfigList
in interfaceConfig
-
getAnyRefList
public List<?> getAnyRefList(String arg0)
- Specified by:
getAnyRefList
in interfaceConfig
-
getBytesList
public List<Long> getBytesList(String arg0)
- Specified by:
getBytesList
in interfaceConfig
-
getMemorySizeList
public List<ConfigMemorySize> getMemorySizeList(String arg0)
- Specified by:
getMemorySizeList
in interfaceConfig
-
getMillisecondsList
@Deprecated public List<Long> getMillisecondsList(String arg0)
Deprecated.- Specified by:
getMillisecondsList
in interfaceConfig
-
getNanosecondsList
@Deprecated public List<Long> getNanosecondsList(String arg0)
Deprecated.- Specified by:
getNanosecondsList
in interfaceConfig
-
getDurationList
public List<Long> getDurationList(String arg0, TimeUnit arg1)
- Specified by:
getDurationList
in interfaceConfig
-
getDurationList
public List<Duration> getDurationList(String arg0)
- Specified by:
getDurationList
in interfaceConfig
-
withOnlyPath
public Config withOnlyPath(String arg0)
- Specified by:
withOnlyPath
in interfaceConfig
-
withoutPath
public Config withoutPath(String arg0)
- Specified by:
withoutPath
in interfaceConfig
-
withValue
public Config withValue(String arg0, ConfigValue arg1)
-
-