Package cc.carm.lib.configuration.source
Class ConfigurationHolder<SOURCE extends ConfigureSource<?,?,SOURCE>>
java.lang.Object
cc.carm.lib.configuration.source.ConfigurationHolder<SOURCE>
public abstract class ConfigurationHolder<SOURCE extends ConfigureSource<?,?,SOURCE>>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull ValueAdapterRegistry
protected @NotNull ConfigExceptionHandler
protected final @NotNull ConfigurationInitializer
protected final @NotNull Map
<String, ConfigurationMetaHolder> protected final @NotNull ConfigurationOptionHolder
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationHolder
(@NotNull ValueAdapterRegistry adapters, @NotNull ConfigurationOptionHolder options, @NotNull Map<String, ConfigurationMetaHolder> metadata, @NotNull ConfigurationInitializer initializer) ConfigurationHolder
(@NotNull ValueAdapterRegistry adapters, @NotNull ConfigurationOptionHolder options, @NotNull Map<String, ConfigurationMetaHolder> metadata, @NotNull ConfigurationInitializer initializer, @NotNull ConfigExceptionHandler exceptionHandler) -
Method Summary
Modifier and TypeMethodDescriptionadapters()
abstract SOURCE
config()
<T> T
deserialize
(@NotNull ValueType<T> type, @Nullable Object source) <T> T
deserialize
(@NotNull Class<T> type, @Nullable Object source) void
exceptionally
(@NotNull ConfigExceptionHandler handler) extractMetadata
(@NotNull ConfigurationMetadata<M> type) extractMetadata
(@NotNull ConfigurationMetadata<M> type, @NotNull Predicate<@Nullable M> filter) void
initialize
(@NotNull Configuration config) void
initialize
(@NotNull ValueManifest<?, ?> value) void
initialize
(Class<? extends Configuration> configClass) @NotNull Map
<String, ConfigurationMetaHolder> metadata()
@NotNull ConfigurationMetaHolder
<O> O
option
(@NotNull ConfigurationOption<O> option) options()
@NotNull @UnmodifiableView Map
<String, ConfigValue<?, ?>> void
reload()
void
save()
<T> @Nullable Object
serialize
(T value) void
-
Field Details
-
adapters
-
options
-
metadata
-
initializer
-
exceptionHandler
-
-
Constructor Details
-
ConfigurationHolder
public ConfigurationHolder(@NotNull @NotNull ValueAdapterRegistry adapters, @NotNull @NotNull ConfigurationOptionHolder options, @NotNull @NotNull Map<String, ConfigurationMetaHolder> metadata, @NotNull @NotNull ConfigurationInitializer initializer) -
ConfigurationHolder
public ConfigurationHolder(@NotNull @NotNull ValueAdapterRegistry adapters, @NotNull @NotNull ConfigurationOptionHolder options, @NotNull @NotNull Map<String, ConfigurationMetaHolder> metadata, @NotNull @NotNull ConfigurationInitializer initializer, @NotNull @NotNull ConfigExceptionHandler exceptionHandler)
-
-
Method Details
-
config
-
reload
- Throws:
Exception
-
save
- Throws:
Exception
-
options
-
option
-
metadata
-
metadata
-
extractMetadata
@NotNull public <M> @NotNull @UnmodifiableView Map<String,M> extractMetadata(@NotNull @NotNull ConfigurationMetadata<M> type) -
extractMetadata
@NotNull public <M> @NotNull @UnmodifiableView Map<String,M> extractMetadata(@NotNull @NotNull ConfigurationMetadata<M> type, @NotNull @NotNull Predicate<@Nullable M> filter) -
registeredValues
-
adapters
-
initializer
-
deserialize
@Nullable public <T> T deserialize(@NotNull @NotNull Class<T> type, @Nullable @Nullable Object source) throws Exception - Throws:
Exception
-
deserialize
@Nullable public <T> T deserialize(@NotNull @NotNull ValueType<T> type, @Nullable @Nullable Object source) throws Exception - Throws:
Exception
-
serialize
- Throws:
Exception
-
initialize
-
initialize
-
initialize
-
throwing
-
exceptionally
-