Link Search Menu Expand Document

By far the simplest way to use config4k is via Kotlin Delegated Properties:

val config =
    ConfigFactory.parseString(
        """
|stringValue = hello
|booleanValue = true
|"""
            .trimMargin(),
    )

val stringValue: String by config
println(stringValue) // hello

val nullableStringValue: String? by config
println(nullableStringValue) // null

val booleanValue: Boolean by config
println(booleanValue) // true

Copyright © 2016-2021 morihiro, since 2021 The Config4k Team. Distributed by an Apache License 2.0.