googlesheets{
dmkb_sheet = "1xEC8CPlKn654321wcoS_JB12345cPPiaA0M"
other_sheet = "123isS0M30TH3R1D"
}
I would like to use something like myConfig.getAsMap("googlesheets")
and get the two nested entries as a Map. No such method exists. So what is the easiest way to load the two nested entries as a Map?
For some definition of easy you could use something like this:
val config = conf.atKey("googlesheets")
config.root.keySet.asScala.map(key ⇒ key → config.getString(key)).toMap
I would argue that it would be even easier to use a library for mapping configurations to case classes, like pureconfig
OK, that was easy.
myConfig.getConfig("googlesheets").entrySet()
does the trick
(I was fixated on the method having a "get" prefix, so missed it)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With