Trait/Object

com.twitter.util

Config

Related Docs: object Config | package util

Permalink

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
Known Subclasses
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

    Permalink
    Definition Classes
    Function0

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def computed[A](f: ⇒ A): Required[A]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. implicit def fromRequired[A](req: Required[A]): A

    Permalink
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. implicit def intoList[A](item: A): List[A]

    Permalink
  14. implicit def intoOption[A](item: A): Option[A]

    Permalink
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. lazy val memoized: T

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def optional[A](default: ⇒ A): Required[Option[A]]

    Permalink
  22. def optional[A]: Required[Option[A]]

    Permalink
  23. def required[A](default: ⇒ A): Required[A]

    Permalink
  24. def required[A]: Required[A]

    Permalink
  25. def specified[A](value: A): Specified[A]

    Permalink

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

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. implicit def toSpecified[A](value: ⇒ A): Specified[A]

    Permalink
  28. implicit def toSpecifiedOption[A](value: ⇒ A): Specified[Some[A]]

    Permalink
  29. def toString(): String

    Permalink
    Definition Classes
    Function0 → AnyRef → Any
  30. def validate(): Unit

    Permalink

    Exceptions thrown

    RequiredValuesMissing if there are any missing values.

  31. final def wait(): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from () ⇒ T

Inherited from AnyRef

Inherited from Any

Ungrouped