If you wish to have a convenient way to use config from the Scala code, you may try to use Dynamic
ancestor to access config. Something like:
class RichConfig(cfg:Config) extends Dynamic {
private val `intClassTag` = implicitly[ClassTag[Int]]
def selectDynamic[T](fieldName:String)(implicit ct:ClassTag[T]) =
ct match {
case `intClassTag` =>
cfg.getInt(fieldName)
}
}
Of course it doesn't give you runtime check for existence of the configuration items.