Class AbstractConfigBuilder<TYPE,UNIT,RESULT extends ConfigValue<TYPE,UNIT>,HOLDER extends ConfigurationHolder<?>,SELF extends AbstractConfigBuilder<TYPE,UNIT,RESULT,HOLDER,SELF>>
java.lang.Object
cc.carm.lib.configuration.builder.AbstractConfigBuilder<TYPE,UNIT,RESULT,HOLDER,SELF>
- Direct Known Subclasses:
CommonConfigBuilder
public abstract class AbstractConfigBuilder<TYPE,UNIT,RESULT extends ConfigValue<TYPE,UNIT>,HOLDER extends ConfigurationHolder<?>,SELF extends AbstractConfigBuilder<TYPE,UNIT,RESULT,HOLDER,SELF>>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HOLDERprotected @NotNull BiConsumer<ConfigurationHolder<?>, String> protected @Nullable Stringprotected @NotNull ValueValidator<UNIT> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConfigBuilder(Class<? super HOLDER> providerClass, ValueType<TYPE> type) -
Method Summary
Modifier and TypeMethodDescriptionappend(@NotNull BiConsumer<ConfigurationHolder<?>, String> initializer) append(@NotNull Consumer<ConfigurationHolder<?>> initializer) abstract RESULTbuild()protected @NotNull ValueManifest<TYPE, UNIT> initializer(@NotNull BiConsumer<ConfigurationHolder<?>, String> initializer) <M> SELFmeta(@NotNull ConfigurationMetadata<M> type, M value) meta(@NotNull Consumer<@NotNull ConfigurationMetaHolder> metaConsumer) protected abstract SELFself()type()validate(@NotNull DataValidator<? super UNIT> validator) Validate the value with the specified condition.validate(@NotNull ValueValidator<? super UNIT> validator) Validate the value with the specified condition.Validate the value with the specified condition.Validate the value with the specified condition.validator(@NotNull DataValidator<? super UNIT> validator) Set theDataValidatorfor the value.validator(@NotNull ValueValidator<UNIT> validator) Set theValueValidatorfor the value.
-
Field Details
-
providerClass
-
type
-
holder
-
path
-
valueValidator
-
defaultValueSupplier
-
initializer
-
-
Constructor Details
-
AbstractConfigBuilder
-
-
Method Details
-
type
-
self
-
build
-
holder
-
path
-
validator
Set theValueValidatorfor the value.- Parameters:
validator- The validator to set.- Returns:
- this builder
-
validator
Set theDataValidatorfor the value.- Parameters:
validator- The validator to set.- Returns:
- this builder
-
validate
Validate the value with the specified condition.- Parameters:
validator- The validator to append.- Returns:
- this builder
-
validate
Validate the value with the specified condition.- Parameters:
validator- The validator to append.- Returns:
- this builder
-
validate
public SELF validate(@NotNull @NotNull Predicate<? super UNIT> condition, @NotNull @NotNull Exception exception) Validate the value with the specified condition.- Parameters:
condition- The condition to check, if the condition is false, an exception will be thrown.exception- The exception to throw if the condition is false.- Returns:
- this builder
-
validate
public SELF validate(@NotNull @NotNull Predicate<? super UNIT> condition, @NotNull @NotNull String msg) Validate the value with the specified condition.- Parameters:
condition- The condition to check, if the condition is false, an exception will be thrown.msg- The message to throw if the condition is false.- Returns:
- this builder
-
initializer
-
append
-
append
-
defaults
-
defaults
-
meta
-
meta
-
buildManifest
-