Packages

class Conf extends Serializable with Configurable

Conf is a class that holds data of configuration. Internally, Conf use a ConcurrentHashMap for saving the configuration arguments.

We can instantiate a Conf directly from a Scala Map or a Config from the typesafe config library.

val conf1 = Conf(myMap)  // equivalent to Conf.fromMap(myMap)
val conf2 = Conf(myConfig)  //equivalent to Conf.fromConfig(myConfig)

We can also instantiate manually

val conf3 = new Conf()
conf3.set("k", "v")
conf3.set(Map("k1" -> "v1", "k2" -> "v2"))
conf3 += anotherConf

Configuration arguments can be retrieved by calling the get() method. Conf provide also several implicit converters that handle the type conversion.

For example:

val double = conf.getAs[Double]("dKey")
val intArray = conf.getAs[Array[Int]]("aiKey")
Annotations
@Evolving()
Linear Supertypes
Configurable, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Conf
  2. Configurable
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Conf()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +=(conf: Conf): Conf.this.type
  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( ... ) @native()
  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[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def get(key: String, defaultValue: String): String

    Get a configuration under the string format

    Get a configuration under the string format

    key

    Key of the configuration

  11. def get(key: String): Option[String]

    Get a configuration under the string format

    Get a configuration under the string format

    key

    Key of the configuration

    Definition Classes
    ConfConfigurable
  12. def getAs[T](key: String, defaultValue: T)(implicit arg0: Serializer[T]): T

    Get a configuration and convert to the given type, return a default value if it's not set

    Get a configuration and convert to the given type, return a default value if it's not set

    T

    define the type of output

    key

    Key of the configuration

  13. def getAs[T](key: String)(implicit converter: Serializer[T]): Option[T]

    Get a configuration and convert to the given type, return None if it's not set

    Get a configuration and convert to the given type, return None if it's not set

    T

    define the type of output

    key

    Key of the configuration

    converter

    implicit converter

    Annotations
    @throws( ... )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def has(key: String): Boolean
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  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 set[T](key: String, value: T)(implicit converter: Serializer[T]): Conf.this.type
  22. def set(options: Map[String, String]): Conf.this.type
  23. def set(key: String, value: String): Conf.this.type
    Definition Classes
    ConfConfigurable
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toMap: Map[String, String]
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Configurable

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped