final case class Config(abstractMap: AbstractMap) extends Dynamic with Product with Serializable
This class represents the configuration.
- Since
2015-11-27
- Alphabetic
- By Inheritance
- Config
- Serializable
- Serializable
- Product
- Equals
- Dynamic
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Config(abstractMap: AbstractMap)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val abstractMap: AbstractMap
-
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 aSuccess
if the conversion is successful, aFailure
if it's not.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
merge(thatConfig: Config): Config
Merges two Config objects.
Merges two Config objects. Basically if you look at the configuration as
Map
s, the resulting Config object is like using++
with the two underlyingMap
s, 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" }
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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 otherwisethatConfig
'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" }
- def selectDynamic(key: String): ConfigWalker
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )