How to get a list with the Typesafe config library

前端 未结 4 1442
温柔的废话
温柔的废话 2020-12-28 12:35

I\'m trying in Scala to get a list from a config file like something.conf with TypeSafe.

In something.conf I set the parameter

4条回答
  •  星月不相逢
    2020-12-28 13:29

    For the record, since Scala 2.12 JavaConversions are deprecated so you can:

    import collection.JavaConverters._
    val myList: List[String] = modifyConfig.getStringList("mylist").asScala.toList
    

提交回复
热议问题