Link Search Menu Expand Document

Config4k also supports Enum. Enum is converted to String of its name in the config file.

enum class Size {
    SMALL,
    MEDIUM,
    LARGE,
}

val config = ConfigFactory.parseString("""key = SMALL""")
val small = config.extract<Size>("key")
println(small == Size.SMALL) // true

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