Skip to content

2. Core

carm edited this page Sep 26, 2025 · 2 revisions

Overview

The core architecture of the configured library provides the foundational components and concepts that power the entire configuration system.

This page details the key architectural elements, their relationships, and how they work together to provide a flexible configuration management solution.

Components

The core components of the Configured library include:

  • Configuration: The base interface that configuration interfaces extend
  • ConfigureSection: Represents a section of configuration data with key-value pairs
  • ConfigureSource: Abstract class for different configuration sources
  • ConfigurationHolder: Manages the lifecycle of configuration objects

for values, we have those base types:

  • ConfiguredValue<V>: Represents a single configuration value with type conversion
  • ConfiguredList<V>: Represents a list of configuration values
  • ConfiguredMap<K,V>: Represents a map of configuration values

By extending these base types, we can simply create custom configuration value types with specific serialization and deserialization logic.

e.g ConfiguredText<MSG, RECEIVER> in configured-feature-text module.

Configuration

ConfigureSection

ConfigureSource

ConfigurationHolder

Values

In most case, we use "ConfiguredSomething" to hold the specific values. And in those classes, we usually have static build functions like:

  • of(Instance) to create a new instance with a default value.
  • with(Type) to create a new instance with a specific type.
  • builderOf(Type) to create a builder for complex types.
  • ... and more different methods for different types.

ValueManifest

ValueManifest contains the metadata for a configuration value, including:

  • The type of current value.
  • The initializer function to mount the ConfigurationHolder.
  • The holder of current value.
  • The path of current value in the configuration source.
  • The default value if not set in the configuration source.
  • The adapter(serializer/deserializer) of this value.

ValueAdapter

ValueValidator

ConfiguredValue

ConfiguredList

ConfiguredMap

Custom Value Types

Annotations

Clone this wiki locally