Package me.hsgamer.hscore.config
Interface Config
- All Known Implementing Classes:
AnnotatedConfig
,BukkitConfig
,BungeeConfig
,ConfigurateConfig
,DecorativeConfig
,GsonConfig
,LightningConfig
,SimpleConfig
public interface Config
The interface for all configurations
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
clear()
Remove all paths from the configurationdefault boolean
contains
(PathString path) Check if the configuration contains the pathdefault Object
get
(PathString path) Get the value from the pathget
(PathString path, Object def) Get the value from the pathgetComment
(PathString path) Get the block commentgetComment
(PathString path, CommentType type) Get the comment.default <T> T
getInstance
(PathString path, Class<T> type) Get the value from the pathdefault <T> T
getInstance
(PathString path, T def, Class<T> type) Get the value from the pathdefault Set<PathString>
getKeys
(boolean deep) Get all keys from the root pathdefault Set<PathString>
getKeys
(PathString path, boolean deep) Get all keys from the pathgetName()
Get the name of the configurationdefault Object
getNormalized
(PathString path) Get the normalized value from the pathdefault Object
getNormalized
(PathString path, Object def) Get the normalized value from the pathdefault Map<PathString,
Object> getNormalizedValues
(boolean deep) Get all values from the root pathdefault Map<PathString,
Object> getNormalizedValues
(PathString path, boolean deep) Get all normalized values from the pathGet the original instancedefault Map<PathString,
Object> getValues
(boolean deep) Get all values from the root pathgetValues
(PathString path, boolean deep) Get all values from the pathdefault boolean
isInstance
(PathString path, Class<?> type) Check if the value of the path matches the typeboolean
isNormalizable
(Object object) Check if the object is normalizableNormalize the library-specific objectdefault Object
normalizeObject
(Object object) Normalize the object and its elements if it is a map or a collectionvoid
reload()
Reload the configurationdefault void
remove
(PathString path) Remove the path from the configurationvoid
save()
Save the configurationvoid
set
(PathString path, Object value) Set the value to the pathdefault void
setComment
(PathString path, List<String> value) Set the block commentdefault void
setComment
(PathString path, List<String> value, CommentType type) Set the comment This is a default empty method.default void
setIfAbsent
(Map<PathString, Object> map) Set the values to the path if they are not already setdefault void
setIfAbsent
(PathString path, Object value) Set the value to the path if it is not already setvoid
setup()
Set up the configuration
-
Field Details
-
LOGGER
The logger for ease
-
-
Method Details
-
getOriginal
Object getOriginal()Get the original instance- Returns:
- the original instance
-
get
Get the value from the path- Parameters:
path
- the pathdef
- the default value if the value is not found- Returns:
- the value
-
set
Set the value to the path- Parameters:
path
- the pathvalue
- the value
-
contains
Check if the configuration contains the path- Parameters:
path
- the path- Returns:
- true if it does
-
getName
String getName()Get the name of the configuration- Returns:
- the name
-
getValues
Get all values from the path- Parameters:
path
- the pathdeep
- should we go deeper from the path?- Returns:
- the values
-
setup
void setup()Set up the configuration -
save
void save()Save the configuration -
reload
void reload()Reload the configuration -
normalize
Normalize the library-specific object- Parameters:
object
- the object- Returns:
- the normalized object
-
isNormalizable
Check if the object is normalizable- Parameters:
object
- the object- Returns:
- true if it is
-
remove
Remove the path from the configuration- Parameters:
path
- the path
-
clear
default void clear()Remove all paths from the configuration -
get
Get the value from the path- Parameters:
path
- the path- Returns:
- the value
-
getNormalized
Get the normalized value from the path- Parameters:
path
- the pathdef
- the default value the default value if the value is not found- Returns:
- the value
-
getNormalized
Get the normalized value from the path- Parameters:
path
- the path- Returns:
- the value
-
getInstance
Get the value from the path- Type Parameters:
T
- the type of the value- Parameters:
path
- the pathdef
- the default value if the value is not foundtype
- the type class of the value- Returns:
- the value
-
getInstance
Get the value from the path- Type Parameters:
T
- the type of the value- Parameters:
path
- the pathtype
- the type class of the value- Returns:
- the value
-
isInstance
Check if the value of the path matches the type- Parameters:
path
- the pathtype
- the type class of the value- Returns:
- true if it does
-
getValues
Get all values from the root path- Parameters:
deep
- should we go deeper from the path?- Returns:
- the values
-
getKeys
Get all keys from the path- Parameters:
path
- the pathdeep
- should we go deeper from the path?- Returns:
- the keys
-
getKeys
Get all keys from the root path- Parameters:
deep
- should we go deeper from the path?- Returns:
- the keys
-
getNormalizedValues
Get all normalized values from the path- Parameters:
path
- the pathdeep
- should we go deeper from the path?- Returns:
- the values
-
normalizeObject
Normalize the object and its elements if it is a map or a collection- Parameters:
object
- the object- Returns:
- the normalized object
-
getNormalizedValues
Get all values from the root path- Parameters:
deep
- should we go deeper from the path?- Returns:
- the values
-
setIfAbsent
Set the value to the path if it is not already set- Parameters:
path
- the pathvalue
- the value
-
setIfAbsent
Set the values to the path if they are not already set- Parameters:
map
- the map of values
-
getComment
Get the comment. This is a default empty method. The implementation can override this method to support comments.- Parameters:
path
- the pathtype
- the comment type- Returns:
- the comment
-
setComment
Set the comment This is a default empty method. The implementation can override this method to support comments.- Parameters:
path
- the pathvalue
- the comment, can be null to remove the commenttype
- the comment type
-
getComment
Get the block comment- Parameters:
path
- the path- Returns:
- the comment
- See Also:
-
setComment
Set the block comment- Parameters:
path
- the pathvalue
- the comment, can be null to remove the comment- See Also:
-