Package me.hsgamer.hscore.config.path
Class CommentablePath<T>
java.lang.Object
me.hsgamer.hscore.config.path.CommentablePath<T>
- Type Parameters:
T- the type of the value
- All Implemented Interfaces:
ConfigPath<T>
A commentable config path
-
Constructor Summary
ConstructorsConstructorDescriptionCommentablePath(@NotNull ConfigPath<T> originalPath, @NotNull String... defaultComments) Create a config path -
Method Summary
Modifier and TypeMethodDescription@Nullable StringGet the block comment@Nullable StringgetComment(@NotNull CommentType commentType) Get the comment@Nullable ConfigGet 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)voidsetComment(@NotNull CommentType commentType, @Nullable String comment) Set the commentvoidsetComment(@Nullable String comment) Set the block commentvoidSet 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
-
CommentablePath
public CommentablePath(@NotNull @NotNull ConfigPath<T> originalPath, @NotNull @NotNull String... defaultComments) Create a config path- Parameters:
originalPath- the original config pathdefaultComments- the default comments
-
-
Method Details
-
getValue
Description copied from interface:ConfigPathGet the value- Specified by:
getValuein interfaceConfigPath<T>- Returns:
- the value
-
setValue
Description copied from interface:ConfigPathSet the value- Specified by:
setValuein interfaceConfigPath<T>- 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<T>- 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<T>- Parameters:
value- the valueconfig- the config
-
getPath
Description copied from interface:ConfigPathGet the path to the value- Specified by:
getPathin interfaceConfigPath<T>- Returns:
- the path
-
getConfig
Description copied from interface:ConfigPathGet the config- Specified by:
getConfigin interfaceConfigPath<T>- Returns:
- the config
-
setConfig
Description copied from interface:ConfigPathSet the config.- Specified by:
setConfigin interfaceConfigPath<T>- Parameters:
config- the config
-
migrateConfig
Description copied from interface:ConfigPathManually update the config (Mainly used when updating new settings)- Specified by:
migrateConfigin interfaceConfigPath<T>- Parameters:
config- the config
-
getComment
Get the block comment- Returns:
- the comment
-
setComment
Set the block comment- Parameters:
comment- the comment
-
getComment
Get the comment- Parameters:
commentType- the comment type- Returns:
- the comment
-
setComment
public void setComment(@NotNull @NotNull CommentType commentType, @Nullable @Nullable String comment) Set the comment- Parameters:
commentType- the comment typecomment- the comment
-