1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 10:38:19 +08:00

feat!(value): Redesigned the Configuration api

This commit is contained in:
2025-02-02 22:29:18 +08:00
parent da3d4d1fd2
commit 374a6198d8
58 changed files with 1635 additions and 1383 deletions
@@ -2,7 +2,7 @@ package cc.carm.lib.configuration.commentable;
import cc.carm.lib.configuration.annotation.HeaderComment;
import cc.carm.lib.configuration.annotation.InlineComment;
import cc.carm.lib.configuration.value.meta.ValueMetaType;
import cc.carm.lib.configuration.meta.PathMetadata;
import java.util.Collections;
import java.util.List;
@@ -12,11 +12,11 @@ public interface CommentableMetaTypes {
/**
* Configuration's {@link HeaderComment}
*/
ValueMetaType<List<String>> HEADER_COMMENTS = ValueMetaType.of(Collections.emptyList());
PathMetadata<List<String>> HEADER_COMMENTS = PathMetadata.of(Collections.emptyList());
/**
* Configuration's {@link InlineComment}
*/
ValueMetaType<String> INLINE_COMMENT_VALUE = ValueMetaType.of();
PathMetadata<String> INLINE_COMMENT_VALUE = PathMetadata.of();
}
@@ -1,6 +1,6 @@
package cc.carm.lib.configuration.option;
import cc.carm.lib.easyoptions.OptionType;
import cc.carm.lib.configuration.source.option.ConfigurationOption;
public interface CommentableOptions {
@@ -8,7 +8,7 @@ public interface CommentableOptions {
* Whether to keep modified comments in configuration,
* that means we only set comments for values that are not exists in configuration.
*/
OptionType<Boolean> KEEP_COMMENTS = OptionType.of(true);
ConfigurationOption<Boolean> KEEP_COMMENTS = ConfigurationOption.of(true);
/**
* Whether to comment values name that are not exists in configuration and no default value offered.
@@ -19,6 +19,6 @@ public interface CommentableOptions {
* # foo:
* </pre></blockquote>
*/
OptionType<Boolean> COMMENT_NO_DEFAULT = OptionType.of(true);
ConfigurationOption<Boolean> COMMENT_NO_DEFAULT = ConfigurationOption.of(true);
}