Packages

  • package root
    Definition Classes
    root
  • package de
    Definition Classes
    root
  • package h2b
    Definition Classes
    de
  • package scala
    Definition Classes
    h2b
  • package lib
    Definition Classes
    scala
  • package util

    This is a Scala library of programming utilities.

    This is a Scala library of programming utilities. It is not intended to comprise a systematic collection but contains some tools that may be useful for some applications.

    Some highlights are a number of probability distributions, a command-line interface, a configuration package, an RSS utility, a class to handle temporary directories, control structures, a logger trait and a timer.

    Definition Classes
    lib
  • package config

    This package provides various configuration sources under a common trait Config, which is basically an immutable map.

    This package provides various configuration sources under a common trait Config, which is basically an immutable map. The following implementations are available:

    - ArgsConfig loads key/value pairs from an array of strings: array elements that contain a separator char (defined by ArgsConfig.SeparatorChar) are considered as key/value pairs, while elements not consumed by this rule can be retrieved by the remaining array (makes it suitable to scan a command line for such key/value pairs and parsing the rest with tools like described in [U1 Command-Line Interface](#u1-command-line-interface).

    - FileConfig loads key/value pairs from a specified resource file which must conform to the java.util.Properties#load(InputStream) method; there is also a factory method where the resource is looked up under the modified package name of a specified class.

    - BundleConfig loads key/value pairs from a resource bundle (according to the java.util.ResourceBundle class) of a specified base name using a locale option; there is also a factory method where the resource bundle is looked up under the modified package name of a specified class.

    * SystemPropertiesConfig is a Config object that represents the system properties of the JVM.

    * SystemEnvironmentConfig is a Config object that represents the system environment; note that the system may not support environment variables -- in this case, this object is empty.

    Multiple Configs can be combined using the standard map ++ operators, yielding an overall Config.

    Definition Classes
    util
    Example:
    1. import de.h2b.scala.lib.util.config._
      val argsConfig = ArgsConfig("-x key1=val1 /y key2=val2 abc".split(' '))
      val sysConfig = SystemPropertiesConfig
      val otherConfig = Config("one"->1, "two"->2, "three"->3)
      val config = argsConfig ++ sysConfig ++ otherConfig
      println(config.get("key1")) //> Some(val1)
      println(config.get("java.version")) //> Some(1.8.0_121)
      println(config.get("two")) //> Some(2)
      println(argsConfig.remaining.mkString(" ")) //> -x /y abc
  • ArgsConfig
  • BundleConfig
  • Config
  • ConfigFactory
  • FileConfig
  • SystemEnvironmentConfig
  • SystemPropertiesConfig

object FileConfig

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(c: Class[_], name: String): Config[String, String]

    Loads key/value pairs from a resource file of specified name associated with a class.

    Loads key/value pairs from a resource file of specified name associated with a class.

    The resource is looked up under the modified package name of the given class (i.e., with '/' substituted for '.'), unless the resource name begins with a '/', in which case it is looked up under the resource name itself (stripping the leading '/').

    c

    the class for which the resource shall be got

    name

    the name of the desired resource

    returns

    a Config with key/value pairs loaded from the given resource file

    Note

    The content of the file must conform to the java.util.Properties#load(InputStream) method.

    ,

    If some I/O or other exception occurs when loading the file, the resulting Config is empty.

  5. def apply(propFile: File): Config[String, String]

    propFile

    the file from which the key/value pairs are loaded from

    returns

    a Config with key/value pairs loaded from a single properties file

    Note

    The content of the file must conform to the java.util.Properties#load(InputStream) method.

    ,

    If some I/O or other exception occurs when loading the file, the resulting Config is empty.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped