com.lambdista.config

Config

final case class Config(abstractMap: AbstractMap) extends Product with Serializable

This class represents the configuration.

Since

2015-11-27

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Config
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Config(abstractMap: AbstractMap)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val abstractMap: AbstractMap

  7. def as[A](implicit arg0: ConcreteValue[A]): Try[A]

    Tries to convert the configuration to a type for which exists an instance of ConcreteValue in scope.

    Tries to convert the configuration to a type for which exists an instance of ConcreteValue in scope. Since the configuration is represented as a AbstractMap, A is generally a final case class or, simply, AbstractMap. The conversion to a case class happens automatically, you don't need to implement a ConcreteValue instance for it. The only requirement is that the configuration keys and values match the case class's field names and values, respectively. For example, given a config object pointing to this configuration:

    {
    bar: 42,
    baz: "hello"
    }

    and this final case class:

    final case class Foo(bar: Int, baz: String)

    the conversion is possible as in:

    config.as[Foo] // result Success(Foo(42, "hello"))
    returns

    a Try[A], which is a Success if the conversion is successful, a Failure if it's not.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getAs[A](key: String)(implicit arg0: ConcreteValue[A]): Try[A]

    Tries to retrieve a config value and convert it into a concrete Scala value.

    Tries to retrieve a config value and convert it into a concrete Scala value. It may fail in one of two ways:

    1. The key looked for is not found.

    2. The conversion is not doable.

    key

    the key to look for

    returns

  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def merge(thatConfig: Config): Config

    Merges two Config objects.

    Merges two Config objects. Basically if you look at the configuration as Maps, the resulting Config object is like using ++ with the two underlying Maps, as in thisConfig ++ thatConfig. E.g.:

    conf1:

    {
    foo = {
      alpha = 1,
      bar = "hello"
    },
    baz = 42
    }

    conf2:

    {
    foo = {
      baz = 15,
      bar = "goodbye"
    },
    baz = 1,
    zoo = "hi"
    }

    conf1.merge(conf2):

    {
    foo = {
      baz = 15,
      bar = "goodbye"
    },
    baz = 1,
    zoo = "hi"
    }
    thatConfig

    the Config to merge this Config with

    returns

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. def recursivelyMerge(thatConfig: Config): Config

    Merges two Config objects.

    Merges two Config objects. Given a key, if the correspondent value is a map then thatConfig's value is "recursively" merged to this config's value otherwise thatConfig's value replaces this config's value. E.g.:

    conf1:

    {
    foo = {
      alpha = 1,
      bar = "hello"
    },
    baz = 42
    }

    conf2:

    {
    foo = {
      baz = 15,
      bar = "goodbye"
    },
    baz = 1,
    zoo = "hi"
    }

    conf1.recursivelyMerge(conf2):

    {
    foo = {
      alpha = 1,
      baz = 15,
      bar = "goodbye"
    },
    baz = 1,
    zoo = "hi"
    }
    thatConfig

    the Config to merge this Config with

    returns

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

    Definition Classes
    AnyRef
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped