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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -