Link Search Menu Expand Document

Config4k has no option to use different names between code and config file.

data class Person(val name: String, val age: Int)

val config =
    ConfigFactory.parseString(
        """
|key {  
|  name = "foo"
|  age = 20
|}"""
            .trimMargin(),
    )
val person: Person = config.extract("key")
println(person.name) // foo
println(person.age) // 20

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