Trait/Object

breeze.config

Configuration

Related Docs: object Configuration | package config

Permalink

trait Configuration extends AnyRef

Configuration provides a way to read in parameters from an underlying representation, usually a properties file. It automatically parses primitives, strings, and Files, and has the ability to handle more complex types via reflection and byte code munging. For instance, we can read in the following:

case class Foo(bool: Boolean, bar: String, path: File, logLevel: Int = 3)

with the following command: config.readIn[Foo]("foo") and properties file: foo.bool = true bar = test foo.path = /home/dlwh/

logLevel will automatically be inferred from its default. Nested classes are also supported. By default, Configuration will search for a property using a layered approach: foo.baz.bar, then baz.bar, then bar, following by a default if it's provided.

Some amount of type inference of type arguments is performed, but it's by no means perfect. If something doesn't work that you'd like to work, ask on the mailing list.

Subclassing is also supported. If you readIn[T]("foo"), and the property foo is the name of a subclass of T (fully qualified), then the subclass will be read instead.

Self Type
Configuration
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Configuration
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def allPropertyNames: Set[String]

    Permalink
  2. abstract def getProperty(property: String): Option[String]

    Permalink

    Get a raw property without any processing.

    Get a raw property without any processing. Returns None if it's not present.

Concrete Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def backoff(that: Configuration): Configuration

    Permalink

    Use properties from that if not found in this

  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. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def readIn[T](prefix: String = "", enforceFullCoverage: Boolean = false)(implicit arg0: Manifest[T]): T

    Permalink

    Reads in an object, but throw an exception if not found.

  17. final def readIn[T](prefix: String, default: ⇒ T)(implicit arg0: Manifest[T]): T

    Permalink

    Read in a T using a prefix, backing off to default, if necessary.

  18. final def readInTouched[T](prefix: String, default: ⇒ T)(implicit arg0: Manifest[T]): (T, Set[String])

    Permalink

    Read in a T using a prefix, backing off to default, if necessary.

    Read in a T using a prefix, backing off to default, if necessary. Returns T and the set of properties that were used.

  19. final def readInTouched[T](prefix: String)(implicit arg0: Manifest[T]): (T, Set[String])

    Permalink

    Reads in an object, and return the set of property keys we touched

  20. final def readOpt[T](prefix: String = "")(implicit arg0: Manifest[T]): Option[T]

    Permalink

    Read in an object, boxing it if necessary.

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

    Permalink
    Definition Classes
    AnyRef
  22. def toCommandLineString: String

    Permalink
  23. def toPropertiesString: String

    Permalink
  24. def toString(): String

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped