public interface Config extends PluginFile
FileDataType. This value can be of any type, and the class should
typically be implemented through an enum| Modifier and Type | Method and Description |
|---|---|
default <T> T |
as(Class<T> c)
Attempts to return the
Config value as a casted type. |
default Config |
fromOther(FileDataType t)
Facade method for
retrieve(FileDataType, Config) |
default Object |
get()
Gets the current object in memory
|
static Map<String,Object> |
getConfigSectionValue(Object o)
Returns a
Map representative of the passed Object that represents
a section of a YAML file. |
static <T extends FileDataType> |
retrieve(T file,
Config config)
Retrieves an anonymous value which can utilize a
Config parameter to retrieve data from any source |
default Config |
set(Object val)
Sets a value in the
FileDataType |
getConfig, getDefault, getFileLocation, getPath, init, save, savedefault <T> T as(Class<T> c)
Config value as a casted type. If the
value cannot be casted it will attempt to return the default value. If
the default value is inappropriate for the class, the method will
throw a ClassCastException.T - The type of the casting classc - The class type to cast tonull if unable to cast. If the passed
class parameter is of a primitive type or autoboxed primitive,
then a casted value of -1 is returned, or false for
booleans. If the passed class parameter is for String,
then Object.toString() is called on the value insteaddefault Object get()
default Config set(Object val)
FileDataTypeval - The value to setConfig valuestatic Map<String,Object> getConfigSectionValue(Object o)
Map representative of the passed Object that represents
a section of a YAML file. This method neglects the implementation of the
section (whether it be ConfigurationSection or just a
Map), and returns the appropriate value.o - The object to interpretMap representing the sectionstatic <T extends FileDataType> Config retrieve(T file, Config config)
Config parameter to retrieve data from any sourceT - Represents a FileDataType passed to the methodfile - The FileDataType to useconfig - The Config value to search withdefault Config fromOther(FileDataType t)
retrieve(FileDataType, Config)t - A FileDataType to retrieve this config value fromretrieve(FileDataType, Config)Copyright © 2015. All rights reserved.