Package me.hsgamer.hscore.config
Class DecorativeConfig
java.lang.Object
me.hsgamer.hscore.config.DecorativeConfig
- All Implemented Interfaces:
Config
- Direct Known Subclasses:
AnnotatedConfig
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
DecorativeConfig
(Config config) Create a new decorative config -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(PathString path) Check if the configuration contains the pathget
(PathString path, Object def) Get the value from the pathgetComment
(PathString path, CommentType type) Get the comment.getName()
Get the name of the configurationGet the original instanceGet the original configgetValues
(PathString path, boolean deep) Get all values from the pathboolean
isNormalizable
(Object object) Check if the object is normalizableNormalize the library-specific objectvoid
reload()
Reload the configurationvoid
save()
Save the configurationvoid
set
(PathString path, Object value) Set the value to the pathvoid
setComment
(PathString path, List<String> value, CommentType type) Set the comment This is a default empty method.void
setIfAbsent
(PathString path, Object value) 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
clear, get, getComment, getInstance, getInstance, getKeys, getKeys, getNormalized, getNormalized, getNormalizedValues, getNormalizedValues, getValues, isInstance, normalizeObject, remove, setComment, setIfAbsent
-
Field Details
-
config
-
-
Constructor Details
-
DecorativeConfig
Create a new decorative config- Parameters:
config
- the original config
-
-
Method Details
-
getOriginalConfig
Get the original config- 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:
path
- the pathvalue
- the value
-
getValues
Description copied from interface:Config
Get all values from the path -
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
-
getComment
Description copied from interface:Config
Get the comment. This is a default empty method. The implementation can override this method to support comments.- Specified by:
getComment
in interfaceConfig
- Parameters:
path
- the pathtype
- the comment type- Returns:
- the comment
-
setComment
Description copied from interface:Config
Set the comment This is a default empty method. The implementation can override this method to support comments.- Specified by:
setComment
in interfaceConfig
- Parameters:
path
- the pathvalue
- the comment, can be null to remove the commenttype
- the comment type
-