Class/Object

io.github.setl.config

Conf

Related Docs: object Conf | package config

Permalink

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

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +=(conf: Conf): Conf.this.type

    Permalink
  4. final def ==(arg0: Any): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  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. def get(key: String, defaultValue: String): String

    Permalink

    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]

    Permalink

    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

    Permalink

    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]

    Permalink

    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def has(key: String): Boolean

    Permalink
  16. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  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 set[T](key: String, value: T)(implicit converter: Serializer[T]): Conf.this.type

    Permalink
  22. def set(options: Map[String, String]): Conf.this.type

    Permalink
  23. def set(key: String, value: String): Conf.this.type

    Permalink
    Definition Classes
    ConfConfigurable
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toMap: Map[String, String]

    Permalink
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

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

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

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

Inherited from Configurable

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped