Class LightningConfig<F extends de.leonhard.storage.internal.FlatFile>
java.lang.Object
me.hsgamer.hscore.config.simplixstorage.LightningConfig<F>
- Type Parameters:
F
- the flat file type
- All Implemented Interfaces:
Config
public class LightningConfig<F extends de.leonhard.storage.internal.FlatFile>
extends Object
implements Config
The
Config
implementation for SimplixStorage-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Remove all paths from the configurationboolean
Check if the configuration contains the pathGet the value from the pathGet all keys from the pathgetName()
Get the name of the configurationGet the original instanceGet all values from the pathboolean
isNormalizable
(Object object) Check if the object is normalizableNormalize the library-specific objectstatic LightningConfig<de.leonhard.storage.Json>
Create a new config from a Json filestatic LightningConfig<de.leonhard.storage.Toml>
Create a new config from a Toml filestatic LightningConfig<de.leonhard.storage.Yaml>
Create a new config from a Yaml filevoid
reload()
Reload the configurationvoid
save()
Save the configurationvoid
Set the value to the pathvoid
setIfAbsent
(Object value, String... path) Set the value to the path if it is not already setvoid
setup()
Set up the configurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.hsgamer.hscore.config.Config
get, getComment, getComment, getInstance, getInstance, getNormalized, getNormalized, getNormalizedValues, isInstance, normalizeObject, remove, setComment, setComment, setIfAbsent
-
Constructor Details
-
LightningConfig
Create a new config- Parameters:
flatFile
- the flat file
-
-
Method Details
-
ofJson
Create a new config from a Json file- Parameters:
file
- the file- Returns:
- the config
-
ofToml
Create a new config from a Toml file- Parameters:
file
- the file- Returns:
- the config
-
ofYaml
Create a new config from a Yaml file- Parameters:
file
- the file- Returns:
- the config
-
getOriginal
Description copied from interface:Config
Get the original instance- Specified by:
getOriginal
in interfaceConfig
- Returns:
- the original instance
-
get
Description copied from interface:Config
Get the value from the path -
set
Description copied from interface:Config
Set the value to the path -
contains
Description copied from interface:Config
Check if the configuration contains the path -
getName
Description copied from interface:Config
Get the name of the configuration -
setIfAbsent
Description copied from interface:Config
Set the value to the path if it is not already set- Specified by:
setIfAbsent
in interfaceConfig
- Parameters:
value
- the valuepath
- the path
-
getKeys
Description copied from interface:Config
Get all keys from the path -
getValues
Description copied from interface:Config
Get all values from the path -
clear
public void clear()Description copied from interface:Config
Remove all paths from the configuration -
setup
public void setup()Description copied from interface:Config
Set up the configuration -
save
public void save()Description copied from interface:Config
Save the configuration -
reload
public void reload()Description copied from interface:Config
Reload the configuration -
normalize
Description copied from interface:Config
Normalize the library-specific object -
isNormalizable
Description copied from interface:Config
Check if the object is normalizable- Specified by:
isNormalizable
in interfaceConfig
- Parameters:
object
- the object- Returns:
- true if it is
-