ProviderSettings

class ProviderSettings @InternalWowApi constructor(val key: String, val values: Map<String, String> = emptyMap())

The settings of one provider's instance, as its configuration holds them under key: a store's (wow.stores.<name>), a sink's or a transport's (wow.<name>), a peer discovery's or a dataset's. values are keyed relative to key (endpoint, say). Every config a provider is opened with holds one, so a provider reads its settings one way whatever it provides, through its ProviderOptions, and a failure names the setting by its full key.

It remembers which settings were read (read), so a provider's test can hold them to the options it declares.

Fields may be added: a config builds it, so the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(key: String, values: Map<String, String> = emptyMap())

Properties

Link copied to clipboard
val key: String

The configuration key the settings are under, for a provider's failures to name.

Link copied to clipboard

The keys of values asked for, and the prefixes, so a test can hold them to the options a provider declares.

Link copied to clipboard

The settings, by their keys relative to key.

Functions

Link copied to clipboard
fun option(name: String): String?

The setting name, or null when it is not set or blank.

fun <T : Any> option(option: ProviderOption.Defaulted<T>): T

The value of the ProviderOption.Defaulted option: its setting, parsed, else its default, so always one.

fun <T : Any> option(option: ProviderOption<T>): T?

The value of option: its setting, parsed, else its default; fails naming the setting by its full key when the value is not one of the option's type.

Link copied to clipboard
fun options(prefix: String): Map<String, String>

The settings under prefix, their keys relative to it.

The settings under the map option (ProviderOption.map), their keys relative to it.

Link copied to clipboard
open override fun toString(): String