org.streum.configrity

Configuration

case class Configuration(data: Map[String, String], prefix: Option[String]) extends Product with Serializable

A Configuration class stores and allow access to configuration data. Although immutable, several methods allow to easily change configuration data, returning a new Configuration instance.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Configuration
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Configuration(data: Map[String, String])

    Constructs a Configuration with the given data and no prefix

  2. new Configuration(data: Map[String, String], prefix: Option[String])

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++(config: Configuration): Configuration

    Adds another configuration.

    Adds another configuration. The configuration passed in argument will override values.

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def apply[A](key: String, default: A)(implicit converter: ValueConverter[A]): A

    Retrieve and convert configuration data in the wanted type.

    Retrieve and convert configuration data in the wanted type. The user must supply a default value, returned is the key is not found.

  8. def apply[A](key: String)(implicit converter: ValueConverter[A]): A

    Retrieve and convert configuration data in the wanted type.

    Retrieve and convert configuration data in the wanted type. Throws an NoSuchElementException if the data is not defined. The conversion is done by a ValueConverter instance which should be provided or implicitly defined elsewhere.

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def attach(prefix: String, block: Configuration): Configuration

    Attach a configuration as a sub block.

    Attach a configuration as a sub block. Existing entries with same keys will be replaced. Prefix should not end with a 'dot'.

  11. def clear[A](key: String): Configuration

    Removes a configuration value.

    Removes a configuration value. No effect if the value was not previously defined.

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def contains(key: String): Boolean

    Returns true if some value is associated with the given key, else false.

  14. val data: Map[String, String]

  15. def detach(prefix: String): Configuration

    Detach all values whose keys have the given prefix as a new configuration.

    Detach all values whose keys have the given prefix as a new configuration. The initial configuration is not modified. The prefix is removed in the resulting configuration. An important property:

    val c2 = c1.attach(prefix, c1.detach( prefix )
    

    The resulting configuration c2 should be equal to c1.

  16. def detachAll: Map[String, Configuration]

    Detach all values whose keys have a common prefix as a new configuration, and repeat this for the entire set of unique prefixes.

    Detach all values whose keys have a common prefix as a new configuration, and repeat this for the entire set of unique prefixes.

    The initial configuration is not modified. The prefix is removed in the resulting configuration.

  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. def format(fmt: ExportFormat = Configuration.defaultFormat): String

    Convert the map in a string using a provided export format.

    Convert the map in a string using a provided export format. By default, FlatFormat is used.

  20. def get[A](key: String)(implicit converter: ValueConverter[A]): Option[A]

    Retrieve and convert configuration data in the wanted type.

    Retrieve and convert configuration data in the wanted type. Returns None if the data is not defined and Some(x) else. The conversion is done by a ValueConverter instance which should be provided or implicitly defined elsewhere.

  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def include(config: Configuration): Configuration

    Adds another configuration values providing entries which are not present in the present one.

    Adds another configuration values providing entries which are not present in the present one. Useful for defaulting to another Configuration

  23. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. val prefix: Option[String]

  28. def prefixes: Set[String]

    Return the set of unique prefixes in this configuration.

  29. def save(filename: String): Unit

    Saves the configuration to a file

  30. def save(filename: String, fmt: ExportFormat): Unit

    Saves the configuration to a file

  31. def save(file: File, fmt: ExportFormat = Configuration.defaultFormat): Unit

    Saves the configuration to a file

  32. def set[A](key: String, as: List[A]): Configuration

    Sets a new configuration list value.

    Sets a new configuration list value. If the key already exists, previous value is replaced.

  33. def set[A](key: String, a: A): Configuration

    Sets a new configuration value.

    Sets a new configuration value. If the key already exists, previous value is replaced.

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

    Definition Classes
    AnyRef
  35. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped