Package me.hsgamer.hscore.config.path
Class AdvancedConfigPath<F,T>
java.lang.Object
me.hsgamer.hscore.config.path.AdvancedConfigPath<F,T>
- Type Parameters:
F- the type of the raw value from the configT- the type of the final value
- All Implemented Interfaces:
ConfigPath<T>
- Direct Known Subclasses:
SerializableMapConfigPath
An advanced config path
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TConvert to the final valueabstract FconvertToRaw(T value) Convert to the raw value@Nullable ConfigGet the configabstract FgetFromConfig(@NotNull Config config) Get the raw value from the config@NotNull StringgetPath()Get the path to the valuegetValue()Get the valueGet the value from the config.voidmigrateConfig(@NotNull Config config) Manually update the config (Mainly used when updating new settings)voidSet the config.voidSet the valuevoidSet the value to the config.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.hsgamer.hscore.config.path.ConfigPath
reload, setAndSave, setAndSave
-
Constructor Details
-
AdvancedConfigPath
Create a config path- Parameters:
path- the path to the valuedef- the default value if it's not found
-
-
Method Details
-
getFromConfig
Get the raw value from the config- Parameters:
config- the config- Returns:
- the raw value
-
convert
Convert to the final value- Parameters:
rawValue- the raw value- Returns:
- the final value
-
convertToRaw
Convert to the raw value- Parameters:
value- the value- Returns:
- the raw value
-
getValue
Description copied from interface:ConfigPathGet the value- Specified by:
getValuein interfaceConfigPath<F>- Returns:
- the value
-
setValue
Description copied from interface:ConfigPathSet the value- Specified by:
setValuein interfaceConfigPath<F>- Parameters:
value- the value
-
getValue
Description copied from interface:ConfigPathGet the value from the config. This is used to get the value from multiple configs.- Specified by:
getValuein interfaceConfigPath<F>- Parameters:
config- the config- Returns:
- the value
-
setValue
Description copied from interface:ConfigPathSet the value to the config. This is used to set the value to multiple configs.- Specified by:
setValuein interfaceConfigPath<F>- Parameters:
value- the valueconfig- the config
-
getPath
Description copied from interface:ConfigPathGet the path to the value- Specified by:
getPathin interfaceConfigPath<F>- Returns:
- the path
-
getConfig
Description copied from interface:ConfigPathGet the config- Specified by:
getConfigin interfaceConfigPath<F>- Returns:
- the config
-
setConfig
Description copied from interface:ConfigPathSet the config.- Specified by:
setConfigin interfaceConfigPath<F>- Parameters:
config- the config
-
migrateConfig
Description copied from interface:ConfigPathManually update the config (Mainly used when updating new settings)- Specified by:
migrateConfigin interfaceConfigPath<F>- Parameters:
config- the config
-