Spec

interface Spec

Config spec is specification for config.

Config spec describes a group of items with common prefix, which can be loaded into config together using Config.addSpec. Config spec also provides convenient API to specify item in it without hand-written object declaration.

See also

Types

Companion
Link copied to clipboard
object Companion

Functions

addInnerSpec
Link copied to clipboard
abstract fun addInnerSpec(spec: Spec)
Add the specified inner spec into this config spec.
addItem
Link copied to clipboard
abstract fun addItem(item: Item<*>)
Add the specified item into this config spec.
get
Link copied to clipboard
open operator fun get(path: String): Spec
Returns sub-spec in the specified path.
plus
Link copied to clipboard
open operator fun plus(spec: Spec): Spec
Returns a config spec overlapped by the specified facade config spec.
qualify
Link copied to clipboard
open fun qualify(item: Item<*>): String
Qualify item name with prefix of this config spec.
withFallback
Link copied to clipboard
open fun withFallback(spec: Spec): Spec
Returns a config spec backing by the specified fallback config spec.
withPrefix
Link copied to clipboard
open fun withPrefix(prefix: String): Spec
Returns config spec with the specified additional prefix.

Properties

innerSpecs
Link copied to clipboard
abstract val innerSpecs: Set<Spec>
Set of inner specs in this config spec.
items
Link copied to clipboard
abstract val items: Set<Item<*>>
Set of specified items in this config spec.
prefix
Link copied to clipboard
abstract val prefix: String
Common prefix for items in this config spec.

Inheritors

ConfigSpec
Link copied to clipboard

Extensions

lazy
Link copied to clipboard
inline fun <T> Spec.lazy(name: String? = null, description: String = "", noinline thunk: (config: ItemContainer) -> T): LazyProperty<T>
Specify a lazy item in this config spec.
optional
Link copied to clipboard
inline fun <T> Spec.optional(default: T, name: String? = null, description: String = ""): OptionalProperty<T>
Specify an optional item in this config spec.
required
Link copied to clipboard
inline fun <T> Spec.required(name: String? = null, description: String = ""): RequiredProperty<T>
Specify a required item in this config spec.

Sources

jvm source
Link copied to clipboard