Packages

  • package root

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    Ciris is divided into the following set of modules.

    • The cats module integrates with cats for type classes and type class instances.
    • The cats-effect module integrates with cats-effect for type classes for effect types.
    • The core module provides basic functionality and support for standard library types.
    • The enumeratum module integrates with enumeratum to be able to read enumerations.
    • The generic module uses shapeless to be able to read products and coproducts.
    • The refined module integrates with refined to be able to read refinement types.
    • The spire module integrates with spire to be able to read more number types.
    • The squants module integrates with squants to read values with unit of measure.

    If you're looking for usage instructions, please refer to the usage guide.

    Definition Classes
    root
  • package ciris

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    Definition Classes
    root
  • package api
    Definition Classes
    ciris
  • package cats

    Module providing an integration with cats.

    Module providing an integration with cats.

    Definition Classes
    ciris
  • package decoders
    Definition Classes
    ciris
  • package enumeratum

    Module providing an integration with enumeratum.

    Module providing an integration with enumeratum.

    Definition Classes
    ciris
  • package generic

    Module using shapeless for generic derivation of ConfigDecoders.

    Module using shapeless for generic derivation of ConfigDecoders.

    Definition Classes
    ciris
  • package refined

    Module providing an integration with refined.

    Module providing an integration with refined.

    Definition Classes
    ciris
  • package spire

    Module providing an integration with spire.

    Module providing an integration with spire.

    Definition Classes
    ciris
  • package squants

    Module providing an integration with squants.

    Module providing an integration with squants.

    Definition Classes
    ciris
  • ConfigDecoder
  • ConfigEntry
  • ConfigError
  • ConfigErrors
  • ConfigException
  • ConfigKeyType
  • ConfigResult
  • ConfigSource
  • ConfigValue
  • Secret

final class ConfigErrors extends AnyVal

ConfigErrors represents one or more ConfigError errors that occurred while reading one or more ConfigEntry configuration entries. To create a ConfigErrors instance, use the ConfigErrors#apply method.

scala> val errors = ConfigErrors(ConfigError("error1"), ConfigError("error2"))
errors: ConfigErrors = ConfigErrors(ConfigError(error1), ConfigError(error2))

It is possible to retrieve the underlying ConfigError errors in a Vector with toVector. This will not incur any additional overhead, as the class is a value class directly wrapping the Vector.

scala> errors.toVector
res0: Vector[ConfigError] = Vector(ConfigError(error1), ConfigError(error2))

There are also methods for retrieving the messages and size.

scala> errors.messages
res1: Vector[String] = Vector(error1, error2)

scala> errors.size
res2: Int = 2

If you instead want a combined error message, you can use message.

scala> errors.message
res0: String =
- error1.
- error2.

It is also possible to append more ConfigError errors using the append method, returning a new ConfigErrors instance.

scala> val errors2 = errors append ConfigError("error3")
errors2: ConfigErrors = ConfigErrors(ConfigError(error1), ConfigError(error2), ConfigError(error3))

scala> errors2.messages
res3: Vector[String] = Vector(error1, error2, error3)

scala> errors2.size
res4: Int = 3
Source
ConfigErrors.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigErrors
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def append(error: ConfigError): ConfigErrors

    Appends a ConfigError error to this ConfigErrors, leaving this ConfigErrors unmodified.

    Appends a ConfigError error to this ConfigErrors, leaving this ConfigErrors unmodified. Errors will be appended in order, so that the specified error will be last when using methods like toVector.

    error

    the ConfigError error to append

    returns

    a new ConfigErrors with the error appended

    Examples:
    1. scala> val errors = ConfigErrors(ConfigError("error1")) append ConfigError("error2")
      errors: ConfigErrors = ConfigErrors(ConfigError(error1), ConfigError(error2))
      
      scala> errors.toVector
      res0: Vector[ConfigError] = Vector(ConfigError(error1), ConfigError(error2))
    2. ,
    3. you can use ConfigError#append as a convenience method to create a new ConfigErrors instance if you have two ConfigErrors.

      scala> ConfigError("error1") append ConfigError("error2")
      res1: ConfigErrors = ConfigErrors(ConfigError(error1), ConfigError(error2))
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def combine(other: ConfigErrors): ConfigErrors

    Creates a new ConfigErrors instance containing all the errors of both this and other, in that order.

    Creates a new ConfigErrors instance containing all the errors of both this and other, in that order.

    other

    the other ConfigErrors

    returns

    a new ConfigErrors instance

    Example:
    1. scala> ConfigErrors(ConfigError("error1")).combine(ConfigErrors(ConfigError("error2")))
      res0: ConfigErrors = ConfigErrors(ConfigError(error1), ConfigError(error2))
  7. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  9. def message: String

    Returns a combined error message containing the error messages in this ConfigErrors.

    Returns a combined error message containing the error messages in this ConfigErrors. The error messages are guaranteed to be in the same order as the errors.

    returns

    a combined error message of the contained errors

  10. def messages: Vector[String]

    Returns the error messages of the errors in this ConfigErrors.

    Returns the error messages of the errors in this ConfigErrors. The messages are guaranteed to be in the same order as the errors.

    returns

    the error messages of the contained errors

    Example:
    1. scala> ConfigErrors(ConfigError("error1"), ConfigError("error2")).messages
      res0: Vector[String] = Vector(error1, error2)
  11. def size: Int

    Returns the number of errors in this ConfigErrors.

    Returns the number of errors in this ConfigErrors.

    returns

    the number of contained errors

    Example:
    1. scala> ConfigErrors(ConfigError("error1")).size
      res0: Int = 1
  12. def toException: ConfigException

    Converts this ConfigErrors to a ConfigException which can be thrown.

    Converts this ConfigErrors to a ConfigException which can be thrown.

    returns

    a new ConfigException

  13. def toString(): String
    Definition Classes
    ConfigErrors → Any
  14. val toVector: Vector[ConfigError]

Inherited from AnyVal

Inherited from Any

Ungrouped