Package-level declarations
Loading, results, errors, sources and the global holder.
Types
Why a key failed to load. The subclasses are plain classes rather than data classes, so fields can be added later without breaking callers; they still compare by value.
Thrown by ConfigResult.getOrThrow and the generated Konstant.init<Spec> functions. The message lists every error, one per line:
Reads config values from a list of sources. The KSP processor adds a load<Spec>() extension for each @ConfigSpec class, which returns a ConfigResult:
Configures a ConfigLoader.
The outcome of ConfigLoader.explain: the load result plus, for each field in load order, its key, the value used and where it came from. toString renders a table.
A place config values are read from, such as environment variables or a file. For each field, ConfigLoader builds the key in keyFormat, then in each of fallbackKeyFormats, and asks get for each until one returns a value, before moving on to the next source.
String-to-value converters used by generated loaders. Every converter throws IllegalArgumentException (or a subclass) on invalid input, which the loader turns into ConfigError.ConversionFailed.
Describes one config field for ConfigLoader.resolve. Built by generated code.
Marks declarations that exist for code generated by the Konstant KSP processor. They may change in any release without notice, so do not use them directly. Generated files opt in.
How a field's property name becomes a lookup key in a ConfigSource. The examples are for the field maxPoolSize inside a nested spec held in a property named database.
Builds lookup keys from property names for ConfigLoader.resolve and generated code.
Base ConfigSource backed by an in-memory map with case-insensitive fallback lookup. origin, such as a file path, is added to name so reports tell sources of one type apart: TomlSource(config/app.dev.toml).
The outcome of resolving one field. Used by generated code.
Collects sources inside ConfigLoaderBuilder.sources, in the order they are added.
Checks used by generated loaders for the validation annotations. Each returns an error message, or null when the value is valid.
Custom conversion for a field annotated with @Convert(MyConverter::class). Implement it as an object. Throw IllegalArgumentException for invalid input; the message becomes the error's cause.
Functions
Property delegate that lazily extracts a field from a registered config.
configField for when the config type is only known as a KClass.