Skip to content
paradigmatic edited this page Jul 11, 2011 · 1 revision

Configurations can be chained to provide default values. For example given config1:

name    = Bob
age     = 42
married = true

and config2:

married = false
children = false

Then you can include the values of config2 in config1:

val config = config1 include config2
val isMarried = config[Boolean]("married")     // isMarried   == true
val hasChildren = config[Boolean]("children")  // hasChildren == false

Thus config2 provides default values for what is missing in config1. Of course, everything is immutable so the result of include is a new configuration.

Clone this wiki locally