Class ValueManifest<T>
- java.lang.Object
-
- cc.carm.lib.configuration.core.value.ValueManifest<T>
-
- Type Parameters:
T
- 配置值类型
- Direct Known Subclasses:
ConfigValue
public class ValueManifest<T> extends java.lang.Object
配置值描述清单。用于描述一个配置值的相关基础信息。- Author:
- CarmJos
-
-
Field Summary
Fields Modifier and Type Field Description protected @Nullable java.lang.String
configPath
protected T
defaultValue
protected @Nullable java.util.List<java.lang.String>
headerComments
protected @Nullable java.lang.String
inlineComment
protected @Nullable ConfigurationProvider<?>
provider
-
Constructor Summary
Constructors Constructor Description ValueManifest(@Nullable ConfigurationProvider<?> provider, @Nullable java.lang.String configPath, @Nullable java.util.List<java.lang.String> headerComments, @Nullable java.lang.String inlineComment, T defaultValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.lang.String
getConfigPath()
@NotNull ConfigurationWrapper<?>
getConfiguration()
T
getDefaultValue()
@Unmodifiable @Nullable java.util.List<java.lang.String>
getHeaderComments()
@Nullable java.lang.String
getInlineComment()
@NotNull ConfigurationProvider<?>
getProvider()
protected java.lang.Object
getValue()
protected void
initialize(@NotNull ConfigurationProvider<?> provider, @NotNull java.lang.String configPath, @Nullable java.util.List<java.lang.String> headerComments, @Nullable java.lang.String inlineComment)
此方法提供给ConfigInitializer
,以便对配置值的相关信息进行统一初始化操作。static <V> ValueManifest<V>
of(@Nullable ConfigurationProvider<?> provider, @Nullable java.lang.String configPath, @Nullable java.util.List<java.lang.String> headerComments, @Nullable java.lang.String inlineComments)
static <V> ValueManifest<V>
of(@Nullable ConfigurationProvider<?> provider, @Nullable java.lang.String configPath, @Nullable java.util.List<java.lang.String> headerComments, @Nullable java.lang.String inlineComments, V defaultValue)
void
setDefaultValue(T defaultValue)
protected void
setValue(@Nullable java.lang.Object value)
-
-
-
Field Detail
-
provider
@Nullable protected @Nullable ConfigurationProvider<?> provider
-
configPath
@Nullable protected @Nullable java.lang.String configPath
-
headerComments
@Nullable protected @Nullable java.util.List<java.lang.String> headerComments
-
inlineComment
@Nullable protected @Nullable java.lang.String inlineComment
-
defaultValue
@Nullable protected T defaultValue
-
-
Constructor Detail
-
ValueManifest
public ValueManifest(@Nullable @Nullable ConfigurationProvider<?> provider, @Nullable @Nullable java.lang.String configPath, @Nullable @Nullable java.util.List<java.lang.String> headerComments, @Nullable @Nullable java.lang.String inlineComment, @Nullable T defaultValue)
- Parameters:
provider
- 配置文件提供者configPath
- 配置路径headerComments
- 头部注释内容inlineComment
- 行内注释内容defaultValue
- 默认参数值
-
-
Method Detail
-
of
public static <V> ValueManifest<V> of(@Nullable @Nullable ConfigurationProvider<?> provider, @Nullable @Nullable java.lang.String configPath, @Nullable @Nullable java.util.List<java.lang.String> headerComments, @Nullable @Nullable java.lang.String inlineComments)
-
of
public static <V> ValueManifest<V> of(@Nullable @Nullable ConfigurationProvider<?> provider, @Nullable @Nullable java.lang.String configPath, @Nullable @Nullable java.util.List<java.lang.String> headerComments, @Nullable @Nullable java.lang.String inlineComments, @Nullable V defaultValue)
-
initialize
protected void initialize(@NotNull @NotNull ConfigurationProvider<?> provider, @NotNull @NotNull java.lang.String configPath, @Nullable @Nullable java.util.List<java.lang.String> headerComments, @Nullable @Nullable java.lang.String inlineComment)
此方法提供给ConfigInitializer
,以便对配置值的相关信息进行统一初始化操作。- Parameters:
provider
- 配置文件提供者configPath
- 配置路径headerComments
- 头部注释内容inlineComment
- 行内注释内容
-
getDefaultValue
@Nullable public T getDefaultValue()
-
setDefaultValue
public void setDefaultValue(@Nullable T defaultValue)
-
getProvider
@NotNull public @NotNull ConfigurationProvider<?> getProvider()
-
getConfiguration
@NotNull public final @NotNull ConfigurationWrapper<?> getConfiguration()
-
getConfigPath
@NotNull public @NotNull java.lang.String getConfigPath()
-
getValue
protected java.lang.Object getValue()
-
setValue
protected void setValue(@Nullable @Nullable java.lang.Object value)
-
getInlineComment
@Nullable public @Nullable java.lang.String getInlineComment()
-
getHeaderComments
@Nullable public @Unmodifiable @Nullable java.util.List<java.lang.String> getHeaderComments()
-
-