Class ConfiguredSection<V>
- java.lang.Object
-
- cc.carm.lib.configuration.core.value.ValueManifest<T>
-
- cc.carm.lib.configuration.core.value.ConfigValue<T>
-
- cc.carm.lib.configuration.core.value.impl.CachedConfigValue<V>
-
- cc.carm.lib.configuration.core.value.type.ConfiguredSection<V>
-
public class ConfiguredSection<V> extends CachedConfigValue<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull ConfigValueParser<ConfigurationWrapper<?>,V>parserprotected @NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>>serializerprotected @NotNull java.lang.Class<V>valueClass-
Fields inherited from class cc.carm.lib.configuration.core.value.impl.CachedConfigValue
cachedValue, parsedTime
-
Fields inherited from class cc.carm.lib.configuration.core.value.ValueManifest
configPath, defaultValue, headerComments, inlineComment, provider
-
-
Constructor Summary
Constructors Constructor Description ConfiguredSection(@NotNull ValueManifest<V> manifest, @NotNull java.lang.Class<V> valueClass, @NotNull ConfigValueParser<ConfigurationWrapper<?>,V> parser, @NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>> serializer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> @NotNull SectionValueBuilder<V>builderOf(@NotNull java.lang.Class<V> valueClass)Vget()得到该配置的设定值(即读取到的值)。@NotNull ConfigValueParser<ConfigurationWrapper<?>,V>getParser()@NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>>getSerializer()@NotNull java.lang.Class<V>getValueClass()voidset(V value)设定该配置的值。-
Methods inherited from class cc.carm.lib.configuration.core.value.impl.CachedConfigValue
getCachedOrDefault, getCachedOrDefault, getCachedValue, getDefaultFirst, isExpired, updateCache
-
Methods inherited from class cc.carm.lib.configuration.core.value.ConfigValue
builder, getNotNull, getOptional, getOrDefault, initialize, isDefault, setDefault, setDefault
-
Methods inherited from class cc.carm.lib.configuration.core.value.ValueManifest
getConfigPath, getConfiguration, getDefaultValue, getHeaderComments, getInlineComment, getProvider, getValue, initialize, of, of, setDefaultValue, setValue
-
-
-
-
Field Detail
-
valueClass
@NotNull protected final @NotNull java.lang.Class<V> valueClass
-
parser
@NotNull protected final @NotNull ConfigValueParser<ConfigurationWrapper<?>,V> parser
-
serializer
@NotNull protected final @NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>> serializer
-
-
Constructor Detail
-
ConfiguredSection
public ConfiguredSection(@NotNull @NotNull ValueManifest<V> manifest, @NotNull @NotNull java.lang.Class<V> valueClass, @NotNull @NotNull ConfigValueParser<ConfigurationWrapper<?>,V> parser, @NotNull @NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>> serializer)
-
-
Method Detail
-
builderOf
@NotNull public static <V> @NotNull SectionValueBuilder<V> builderOf(@NotNull @NotNull java.lang.Class<V> valueClass)
-
getValueClass
@NotNull public @NotNull java.lang.Class<V> getValueClass()
-
getParser
@NotNull public @NotNull ConfigValueParser<ConfigurationWrapper<?>,V> getParser()
-
getSerializer
@NotNull public @NotNull ConfigDataFunction<V,? extends java.util.Map<java.lang.String,java.lang.Object>> getSerializer()
-
get
@Nullable public V get()
Description copied from class:ConfigValue得到该配置的设定值(即读取到的值)。
若初始化时未写入默认值,则可以通过ConfigValue.getOrDefault()方法在该设定值为空时获取默认值。- Specified by:
getin classConfigValue<V>- Returns:
- 设定值
-
set
public void set(V value)
Description copied from class:ConfigValue设定该配置的值。
设定后,不会自动保存配置文件;若需要保存,请调用ConfigurationProvider.save()方法。- Specified by:
setin classConfigValue<V>- Parameters:
value- 配置的值
-
-