Created
September 27, 2018 06:48
-
-
Save codeomnitrix/cd221882d4a9d464b0413b2cfb7d5f07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pureconfig._ | |
import com.typesafe.config.ConfigFactory | |
case class Person(id: Int, name: String, number: String) | |
object PureConfigTest extends App { | |
val person = loadConfig[Person](ConfigFactory.load("conf123/application.conf")) match { | |
case Right(conf) => conf | |
case Left(failures) => | |
throw new Exception(s"Unable to load the configuration ${failures.toList.mkString("\n")}") | |
} | |
println(person.name) | |
println(person.number) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment