Link Search Menu Expand Document

Config4k also supports default values. extract<T, T?> method returns T when the path exists and default value when it does not exist.

val config = ConfigFactory.parseString("""key = 10""")
val key = config.extract("unknown", 20)
println(key) // 20

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