MapBackedSource

abstract class MapBackedSource(entries: Map<String, String>, origin: String? = null) : ConfigSource(source)

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).

Constructors

Link copied to clipboard
constructor(entries: Map<String, String>, origin: String? = null)

Properties

Link copied to clipboard

Further formats tried in order when the key in keyFormat has no value. None by default.

Link copied to clipboard
abstract val keyFormat: KeyFormat

The key format tried first, e.g. KeyFormat.SCREAMING_SNAKE for environment variables.

Link copied to clipboard
open override val name: String

A short label for reports such as ConfigLoader.explain, e.g. TomlSource.

Functions

Link copied to clipboard
open override fun children(key: String): Map<String, String>?

Entries nested under key as key.child, keyed by child, or null if there are none. Sources that flatten tables and mappings (TOML, YAML, properties) use this to fill Map fields.

Link copied to clipboard
open override fun get(key: String): String?

The raw text for key, or null if this source does not have it.