Packages

trait Config[T] extends () ⇒ T

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 }

Annotations
@deprecated
Deprecated

(Since version ) use a Plain Old Scala Object

Linear Supertypes
() ⇒ T, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Config
  2. Function0
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(): T
    Definition Classes
    Function0

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def computed[A](f: ⇒ A): Required[A]

    The same as specifying required[A] with a default value, but the intent to the use is slightly different.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. implicit def fromRequired[A](req: Required[A]): A
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. implicit def intoList[A](item: A): List[A]
  14. implicit def intoOption[A](item: A): Option[A]
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. lazy val memoized: T

    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

  17. def missingValues: Seq[String]

    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.

    Note

    as of Scala 2.12 the returned values are not always correct. See ConfigTest for an example.

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def optional[A](default: ⇒ A): Required[Option[A]]
  22. def optional[A]: Required[Option[A]]
  23. def required[A](default: ⇒ A): Required[A]
  24. def required[A]: Required[A]
  25. def specified[A](value: A): Specified[A]

    a non-lazy way to create a Specified that can be called from java

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. implicit def toSpecified[A](value: ⇒ A): Specified[A]
  28. implicit def toSpecifiedOption[A](value: ⇒ A): Specified[Some[A]]
  29. def toString(): String
    Definition Classes
    Function0 → AnyRef → Any
  30. def validate(): Unit

    Exceptions thrown

    RequiredValuesMissing if there are any missing values.

  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from () ⇒ T

Inherited from AnyRef

Inherited from Any

Ungrouped