scala - Iterate over fields in typesafe config file -
in scala application have configuration this:
datasets { dataset1 = "path1" dataset2 = "path2" dataset3 = "path3" }
ho iterate on datasets map [dataset, path]?
you can call entryset()
after getting config getconfig()
import scala.collection.javaconversions._ val config = configfactory.load() val datasets = config.getconfig("datasets") val configmap = datasets.entryset().tolist.map( entry => (entry.getkey, entry.getvalue) ).tomap
you end map[string, configvalue]
.
Comments
Post a Comment