Packages

trait ConfigSource extends AnyRef

Self Type
ConfigSource
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def getConfigValue(keys: List[ConfigSourceModule.K]): PropertyTree[ConfigSourceModule.K, ConfigSourceModule.V]
  2. abstract def leafForSequence: LeafForSequence
  3. abstract def names: Set[ConfigSourceName]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def <>(that: => ConfigSource): ConfigSource

    <> is an alias to orElse.

    <> is an alias to orElse. Try this (configSource), and if it fails, try that (configSource)

    For example:

    Given three configSources, configSource1, configSource2 and configSource3, such that configSource1 and configSource2 will only have id and configSource3 act as a global fall-back source.

    The following config tries to fetch Id from configSource1, and if fails, it tries configSource2, and if both fails it gets from configSource3. Age will be fetched only from configSource3.

    val config = (string("Id") from (configSource1 orElse configSource2) |@| int("Age"))(Person.apply, Person.unapply)
    read(config from configSource3)
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def convertKeys(f: (ConfigSourceModule.K) => ConfigSourceModule.K): ConfigSource

    Convert the keys before it is queried from ConfigSource.

    Convert the keys before it is queried from ConfigSource.

    For example:

    Given two configSources, configSource1 and configSource2, such that configSource1 can have uppercase ID and lowercase age, and configSource2 can have lowercase ID and uppercase age.

    The following solution will not help here, as you would imagine. config.mapKeys(_.toUpperCase) from configSource1 orElse config.mapKeys(_.toLowerCase) from configSource2)

    A correct solution here would be the following, indicating the fact configSources act differently for different fields.

    val idSource = configSource1.convertKeys(_.toUpperCase) <> configSource2.convertKeys(_.toLowerCase)
    val ageSource = configSource1.convertKeys(_.toLowerCase) <> configSource2.convertKeys(_.toUpperCase)
    
    val config = (string("Id") from idSource |@| int("Age") from ageSource)(Person.apply, Person.unapply)
    read(config)
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def orElse(that: => ConfigSource): ConfigSource

    Try this (configSource), and if it fails, try that (configSource)

    Try this (configSource), and if it fails, try that (configSource)

    For example:

    Given three configSources, configSource1, configSource2 and configSource3, such that configSource1 and configSource2 will only have id and configSource3 act as a global fall-back source.

    The following config tries to fetch Id from configSource1, and if fails, it tries configSource2, and if both fails it gets from configSource3. Age will be fetched only from configSource3.

    val config = (string("Id") from (configSource1 orElse configSource2) |@| int("Age"))(Person.apply, Person.unapply)
    read(config from configSource3)
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped