Package cc.carm.lib.configuration.value
Class ValueManifest<TYPE,UNIT>
- java.lang.Object
-
- cc.carm.lib.configuration.value.ValueManifest<TYPE,UNIT>
-
- Direct Known Subclasses:
ConfigValue
public class ValueManifest<TYPE,UNIT> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull java.util.function.Supplier<@Nullable TYPE>
defaultSupplier
protected @Nullable ConfigurationHolder<?>
holder
protected @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String>
initializer
protected @Nullable java.lang.String
path
protected @NotNull ValueType<TYPE>
type
protected @NotNull ValueValidator<UNIT>
validator
-
Constructor Summary
Constructors Modifier Constructor Description ValueManifest(@NotNull ValueType<TYPE> type)
ValueManifest(@NotNull ValueType<TYPE> type, @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier)
ValueManifest(@NotNull ValueType<TYPE> type, @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull ValueValidator<UNIT> validator)
ValueManifest(@NotNull ValueType<TYPE> type, @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull ValueValidator<UNIT> validator, @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String> initializer)
ValueManifest(@NotNull ValueType<TYPE> type, @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull ValueValidator<UNIT> validator, @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String> initializer, @Nullable ConfigurationHolder<?> holder, @Nullable java.lang.String path)
protected
ValueManifest(@NotNull ValueManifest<TYPE,UNIT> manifest)
ValueManifest(TYPE defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ConfigureSource<?,?,?>
config()
TYPE
defaults()
void
defaults(@NotNull java.util.function.Supplier<@Nullable TYPE> defaultValue)
void
defaults(TYPE defaultValue)
protected @Nullable java.lang.Object
getData()
boolean
hasDefaults()
@NotNull ConfigurationHolder<?>
holder()
void
holder(@NotNull ConfigurationHolder<?> holder)
protected void
initialize()
void
initialize(@NotNull ConfigurationHolder<?> holder, @NotNull java.lang.String path)
@NotNull ConfigurationMetaHolder
metadata()
@NotNull java.lang.String
path()
void
path(@NotNull java.lang.String path)
protected void
setData(@Nullable java.lang.Object value)
protected void
throwing(@NotNull java.lang.String path, @NotNull java.lang.Throwable throwable)
protected void
throwing(@NotNull java.lang.Throwable throwable)
@NotNull ValueType<TYPE>
type()
void
validate(@NotNull ValueValidator<UNIT> validator)
@NotNull ValueValidator<UNIT>
validator()
void
validator(@NotNull ValueValidator<UNIT> validator)
protected UNIT
withValidated(UNIT value)
-
-
-
Field Detail
-
initializer
@NotNull protected final @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String> initializer
-
holder
@Nullable protected @Nullable ConfigurationHolder<?> holder
-
path
@Nullable protected @Nullable java.lang.String path
-
validator
@NotNull protected @NotNull ValueValidator<UNIT> validator
-
defaultSupplier
@NotNull protected @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier
-
-
Constructor Detail
-
ValueManifest
public ValueManifest(@NotNull TYPE defaultValue)
-
ValueManifest
public ValueManifest(@NotNull @NotNull ValueType<TYPE> type, @NotNull @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier)
-
ValueManifest
public ValueManifest(@NotNull @NotNull ValueType<TYPE> type, @NotNull @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull @NotNull ValueValidator<UNIT> validator)
-
ValueManifest
public ValueManifest(@NotNull @NotNull ValueType<TYPE> type, @NotNull @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull @NotNull ValueValidator<UNIT> validator, @NotNull @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String> initializer)
-
ValueManifest
public ValueManifest(@NotNull @NotNull ValueType<TYPE> type, @NotNull @NotNull java.util.function.Supplier<@Nullable TYPE> defaultSupplier, @NotNull @NotNull ValueValidator<UNIT> validator, @NotNull @NotNull java.util.function.BiConsumer<@NotNull ConfigurationHolder<?>,@NotNull java.lang.String> initializer, @Nullable @Nullable ConfigurationHolder<?> holder, @Nullable @Nullable java.lang.String path)
-
ValueManifest
protected ValueManifest(@NotNull @NotNull ValueManifest<TYPE,UNIT> manifest)
-
-
Method Detail
-
initialize
public void initialize(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull java.lang.String path)
-
initialize
protected void initialize()
-
holder
public void holder(@NotNull @NotNull ConfigurationHolder<?> holder)
-
path
public void path(@NotNull @NotNull java.lang.String path)
-
defaults
@Nullable public TYPE defaults()
-
defaults
public void defaults(@Nullable TYPE defaultValue)
-
defaults
public void defaults(@NotNull @NotNull java.util.function.Supplier<@Nullable TYPE> defaultValue)
-
hasDefaults
public boolean hasDefaults()
-
validator
@NotNull public @NotNull ValueValidator<UNIT> validator()
-
validator
public void validator(@NotNull @NotNull ValueValidator<UNIT> validator)
-
validate
public void validate(@NotNull @NotNull ValueValidator<UNIT> validator)
-
withValidated
protected UNIT withValidated(@Nullable UNIT value) throws java.lang.Exception
- Throws:
java.lang.Exception
-
path
@NotNull public @NotNull java.lang.String path()
-
holder
@NotNull public @NotNull ConfigurationHolder<?> holder()
-
config
@NotNull public @NotNull ConfigureSource<?,?,?> config()
-
metadata
@NotNull public @NotNull ConfigurationMetaHolder metadata()
-
getData
@Internal @Nullable protected @Nullable java.lang.Object getData()
-
setData
@Internal protected void setData(@Nullable @Nullable java.lang.Object value)
-
throwing
protected void throwing(@NotNull @NotNull java.lang.Throwable throwable)
-
throwing
protected void throwing(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.lang.Throwable throwable)
-
-