mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 10:38:19 +08:00
feat(parse): 新增两种忽略默认值的parseValue方法。
This commit is contained in:
+4
@@ -32,6 +32,10 @@ public class SectionValueBuilder<V>
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @NotNull SectionValueBuilder<V> parseValue(ConfigDataFunction<ConfigurationWrapper<?>, V> valueParser) {
|
||||||
|
return parseValue((section, path) -> valueParser.parse(section));
|
||||||
|
}
|
||||||
|
|
||||||
public @NotNull SectionValueBuilder<V> parseValue(ConfigValueParser<ConfigurationWrapper<?>, V> valueParser) {
|
public @NotNull SectionValueBuilder<V> parseValue(ConfigValueParser<ConfigurationWrapper<?>, V> valueParser) {
|
||||||
this.parser = valueParser;
|
this.parser = valueParser;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
+4
@@ -39,6 +39,10 @@ public class SourceValueBuilder<S, V> extends CommonConfigBuilder<V, SourceValue
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @NotNull SourceValueBuilder<S, V> parseValue(ConfigDataFunction<S, V> valueParser) {
|
||||||
|
return parseValue((section, path) -> valueParser.parse(section));
|
||||||
|
}
|
||||||
|
|
||||||
public @NotNull SourceValueBuilder<S, V> parseValue(@NotNull ConfigValueParser<S, V> valueParser) {
|
public @NotNull SourceValueBuilder<S, V> parseValue(@NotNull ConfigValueParser<S, V> valueParser) {
|
||||||
this.valueParser = valueParser;
|
this.valueParser = valueParser;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user