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 HOLDER
protected @NotNull BiConsumer
<ConfigurationHolder<?>, String> protected @Nullable String
protected @NotNull ValueValidator
<UNIT> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractConfigBuilder
(Class<? super HOLDER> providerClass, ValueType<TYPE> type) -
Method Summary
Modifier and TypeMethodDescriptionappend
(@NotNull BiConsumer<ConfigurationHolder<?>, String> initializer) append
(@NotNull Consumer<ConfigurationHolder<?>> initializer) abstract RESULT
build()
protected @NotNull ValueManifest
<TYPE, UNIT> initializer
(@NotNull BiConsumer<ConfigurationHolder<?>, String> initializer) <M> SELF
meta
(@NotNull ConfigurationMetadata<M> type, M value) meta
(@NotNull Consumer<@NotNull ConfigurationMetaHolder> metaConsumer) protected abstract SELF
self()
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 theDataValidator
for the value.validator
(@NotNull ValueValidator<UNIT> validator) Set theValueValidator
for the value.
-
Field Details
-
providerClass
-
type
-
holder
-
path
-
valueValidator
-
defaultValueSupplier
-
initializer
-
-
Constructor Details
-
AbstractConfigBuilder
-
-
Method Details
-
type
-
self
-
build
-
holder
-
path
-
validator
Set theValueValidator
for the value.- Parameters:
validator
- The validator to set.- Returns:
- this builder
-
validator
Set theDataValidator
for 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
-