The same as specifying required[A] with a default value, but the intent to the use is slightly different.
a lazy singleton of the configured class.
a lazy singleton of the configured class. Allows one to pass the Config around to multiple classes without producing multiple configured instances
Looks for any fields that are Required but currently Unspecified, in this object and in any child Config objects, and returns the names of those missing values.
Looks for any fields that are Required but currently Unspecified, in this object and in any child Config objects, and returns the names of those missing values. For missing values in child Config objects, the name is the dot-separated path down to that value.
a non-lazy way to create a Specified that can be called from java
RequiredValuesMissing
if there are any missing values.
A config object contains vars for configuring an object of type T, and an apply() method which turns this config into an object of type T.
The trait also contains a few useful implicits.
You can define fields that are required but that don't have a default value with: class BotConfig extends Config[Bot] { var botName = required[String] var botPort = required[Int] .... }
Optional fields can be defined with: var something = optional[Duration]
Fields that are dependent on other fields and have a default value computed from an expression should be marked as computed:
var level = required[Int] var nextLevel = computed { level + 1 }
(Since version ) use a Plain Old Scala Object