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

object ConfigDecoder extends ConfigDecoders

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigDecoder
  2. ConfigDecoders
  3. ScalaUtilConfigDecoders
  4. PrimitiveConfigDecoders
  5. MathConfigDecoders
  6. JavaUtilConfigDecoders
  7. JavaTimeConfigDecoders
  8. JavaNioFileConfigDecoders
  9. JavaNioCharsetConfigDecoders
  10. JavaNetConfigDecoders
  11. JavaIoConfigDecoders
  12. DurationConfigDecoders
  13. DerivedConfigDecoders
  14. CirisConfigDecoders
  15. AnyRef
  16. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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[A]: ConfigDecoder[A, A]

    A ConfigDecoder which does not modify the value read from a configuration source.

    A ConfigDecoder which does not modify the value read from a configuration source. This method is an alias and equivalent of ConfigDecoder#identity.

    A

    the type from which to convert the value

    returns

    a new ConfigDecoder which does not modify values

  5. def apply[A, B](implicit decoder: ConfigDecoder[A, B]): ConfigDecoder[A, B]

    Attempt to implicitly find a ConfigDecoder which converts values from type A to type B, and when found, return the ConfigDecoder instance.

    Attempt to implicitly find a ConfigDecoder which converts values from type A to type B, and when found, return the ConfigDecoder instance.

    A

    the type from which to convert the value

    B

    the type to which to convert the value

    decoder

    the implicit ConfigDecoder instance

    returns

    the found ConfigDecoder instance

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. implicit val bigDecimalConfigDecoder: ConfigDecoder[String, BigDecimal]
    Definition Classes
    MathConfigDecoders
  8. implicit val bigIntConfigDecoder: ConfigDecoder[String, BigInt]
    Definition Classes
    MathConfigDecoders
  9. implicit val booleanConfigDecoder: ConfigDecoder[String, Boolean]
    Definition Classes
    PrimitiveConfigDecoders
  10. implicit val byteConfigDecoder: ConfigDecoder[String, Byte]
    Definition Classes
    PrimitiveConfigDecoders
  11. def catchNonFatal[A, B](typeName: String)(f: (A) ⇒ B): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, wrapping the function in a Try.

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, wrapping the function in a Try. If the function, for any reason, throws an exception, it will be interpreted as if the conversion to type B failed.

    B

    the type of value in the specified function

    typeName

    the name of the type B

    f

    the function to apply on the value, returning B

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("1", "a"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.catchNonFatal("Int") { s: String => s.toInt }
      decoder: ConfigDecoder[String, Int] = [email protected]4fee5a39
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, Int] = Right(1)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, Int] = Left(WrongType(1, Argument, Right(a), a, Int, java.lang.NumberFormatException: For input string: "a"))
  12. implicit val charConfigDecoder: ConfigDecoder[String, Char]
    Definition Classes
    PrimitiveConfigDecoders
  13. implicit val charsetConfigDecoder: ConfigDecoder[String, Charset]
    Definition Classes
    JavaNioCharsetConfigDecoders
  14. implicit val chronologyConfigDecoder: ConfigDecoder[String, Chronology]
    Definition Classes
    JavaTimeConfigDecoders
  15. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  16. implicit val dateTimeFormatterConfigDecoder: ConfigDecoder[String, DateTimeFormatter]
    Definition Classes
    JavaTimeConfigDecoders
  17. implicit val dayOfWeekConfigDecoder: ConfigDecoder[String, DayOfWeek]
    Definition Classes
    JavaTimeConfigDecoders
  18. implicit val doubleConfigDecoder: ConfigDecoder[String, Double]
    Definition Classes
    PrimitiveConfigDecoders
  19. implicit val durationConfigDecoder: ConfigDecoder[String, Duration]
    Definition Classes
    DurationConfigDecoders
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  22. implicit val fileConfigDecoder: ConfigDecoder[String, File]
    Definition Classes
    JavaIoConfigDecoders
  23. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. implicit val finiteDurationConfigDecoder: ConfigDecoder[String, FiniteDuration]
    Definition Classes
    DurationConfigDecoders
  25. def flatMap[A, B](f: (A) ⇒ Either[ConfigError, B]): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source.

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source.

    A

    the type from which to convert the value

    B

    the type to which to convert the value

    f

    the function to apply in case of a value

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("123456"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.flatMap { value: String => Right(value.take(2)) }
      decoder: ConfigDecoder[String, String] = ConfigDecode[email protected]77f11239
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, String] = Right(12)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, String] = Left(MissingKey(1, Argument))
  26. implicit val floatConfigDecoder: ConfigDecoder[String, Float]
    Definition Classes
    PrimitiveConfigDecoders
  27. def fold[A, B](onError: (ConfigError) ⇒ Either[ConfigError, B], onValue: (A) ⇒ Either[ConfigError, B]): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in both the error case and in the value case.

    Creates a new ConfigDecoder by applying a function in both the error case and in the value case.

    A

    the type from which to convert the value

    B

    the type to which to convert the value

    onError

    the function to apply in the case of an error

    onValue

    the function to apply in case of a value

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("123456", "abc"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.fold(error => Left(error), (value: String) => Right(value + "/789"))
      decoder: ConfigDecoder[String, String] = [email protected]76e4848f
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, String] = Right(123456/789)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, String] = Right(abc/789)
      
      scala> decoder.decode(source.read(2))
      res2: Either[ConfigError, String] = Left(MissingKey(2, Argument))
  28. implicit val formatStyleConfigDecoder: ConfigDecoder[String, FormatStyle]
    Definition Classes
    JavaTimeConfigDecoders
  29. def fromOption[A, B](typeName: String)(f: (A) ⇒ Option[B]): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning an Option[B].

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning an Option[B]. If the function returns None, it will be interpreted as if the conversion to type B failed.

    A

    the type from which to convert the value

    B

    the type to which to convert the value

    typeName

    the name of the type B

    f

    the function to apply on the value, returning Option[B]

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("1", "25"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.fromOption("String") { s: String => Some(s).filter(_.length == 1) }
      decoder: ConfigDecoder[String, String] = [email protected]4826b7ae
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, String] = Right(1)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, String] = Left(WrongType(1, Argument, Right(25), 25, String))
  30. def fromTry[A, B](typeName: String)(f: (A) ⇒ Try[B]): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning a Try[B].

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning a Try[B]. If the function returns Failure, it will be interpreted as if the conversion to type B failed.

    B

    the type of value in the specified function

    typeName

    the name of the type B

    f

    the function to apply on the value, returning Try[B]

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("1", "a"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.fromTry("Int") { value: String => scala.util.Try(value.toInt) }
      decoder: ConfigDecoder[String, Int] = [email protected]26db094b
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, Int] = Right(1)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, Int] = Left(WrongType(1, Argument, Right(a), a, Int, java.lang.NumberFormatException: For input string: "a"))
  31. def fromTryOption[A, B](typeName: String)(f: (A) ⇒ Try[Option[B]]): ConfigDecoder[A, B]

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning a Try[Option[B]].

    Creates a new ConfigDecoder by applying a function in the case when a value was successfully read from the configuration source, returning a Try[Option[B]]. The conversion will only succeed if the function returns Success[Some[B]].

    B

    the type to convert to

    typeName

    the name of the type B

    f

    the function to apply on the value, returning Try[Option[B]]

    returns

    a new ConfigDecoder[A, B]

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("1", "1234", "a"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.fromTryOption("Int") { value: String => scala.util.Try(if(value.length < 4) Some(value.toInt) else None) }
      decoder: ConfigDecoder[String, Int] = [email protected]7d20803b
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, Int] = Right(1)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, Int] = Left(WrongType(1, Argument, Right(1234), 1234, Int))
      
      scala> decoder.decode(source.read(2))
      res2: Either[ConfigError, Int] = Left(WrongType(2, Argument, Right(a), a, Int, java.lang.NumberFormatException: For input string: "a"))
      
      scala> decoder.decode(source.read(3))
      res3: Either[ConfigError, Int] = Left(MissingKey(3, Argument))
  32. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. implicit val hijrahEraConfigDecoder: ConfigDecoder[String, HijrahEra]
    Definition Classes
    JavaTimeConfigDecoders
  35. def identity[A]: ConfigDecoder[A, A]

    A ConfigDecoder which does not modify the value read from a configuration source.

    A ConfigDecoder which does not modify the value read from a configuration source. Most often not useful on its own, but can be used as a starting point for other types of ConfigDecoders.

    A

    the type from which to convert the value

    returns

    a new ConfigDecoder which does not modify values

    Example:
    1. scala> val source = ConfigSource.byIndex(ConfigKeyType.Argument)(Vector("123456", "abc"))
      source: ConfigSource[Int, String] = ConfigSource(Argument)
      
      scala> val decoder = ConfigDecoder.identity[String]
      decoder: ConfigDecoder[String, String] = [email protected]245c7250
      
      scala> decoder.decode(source.read(0))
      res0: Either[ConfigError, String] = Right(123456)
      
      scala> decoder.decode(source.read(1))
      res1: Either[ConfigError, String] = Right(abc)
      
      scala> decoder.decode(source.read(2))
      res2: Either[ConfigError, String] = Left(MissingKey(2, Argument))
  36. implicit def identityConfigDecoder[A]: ConfigDecoder[A, A]
    Definition Classes
    PrimitiveConfigDecoders
  37. implicit val inetAddressConfigDecoder: ConfigDecoder[String, InetAddress]
    Definition Classes
    JavaNetConfigDecoders
  38. implicit val instantConfigDecoder: ConfigDecoder[String, Instant]
    Definition Classes
    JavaTimeConfigDecoders
  39. implicit val intConfigDecoder: ConfigDecoder[String, Int]
    Definition Classes
    PrimitiveConfigDecoders
  40. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  41. implicit val isoEraConfigDecoder: ConfigDecoder[String, IsoEra]
    Definition Classes
    JavaTimeConfigDecoders
  42. implicit val japaneseEraConfigDecoder: ConfigDecoder[String, JapaneseEra]
    Definition Classes
    JavaTimeConfigDecoders
  43. implicit val javaBigDecimalConfigDecoder: ConfigDecoder[String, BigDecimal]
    Definition Classes
    MathConfigDecoders
  44. implicit val javaBigIntegerConfigDecoder: ConfigDecoder[String, BigInteger]
    Definition Classes
    MathConfigDecoders
  45. implicit val javaTimeDurationConfigDecoder: ConfigDecoder[String, Duration]
    Definition Classes
    JavaTimeConfigDecoders
  46. implicit def localDateConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, LocalDate]
    Definition Classes
    JavaTimeConfigDecoders
  47. implicit def localDateTimeConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, LocalDateTime]
    Definition Classes
    JavaTimeConfigDecoders
  48. implicit def localTimeConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, LocalTime]
    Definition Classes
    JavaTimeConfigDecoders
  49. implicit val longConfigDecoder: ConfigDecoder[String, Long]
    Definition Classes
    PrimitiveConfigDecoders
  50. implicit val minguoEraConfigDecoder: ConfigDecoder[String, MinguoEra]
    Definition Classes
    JavaTimeConfigDecoders
  51. implicit val monthConfigDecoder: ConfigDecoder[String, Month]
    Definition Classes
    JavaTimeConfigDecoders
  52. implicit def monthDayConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, MonthDay]
    Definition Classes
    JavaTimeConfigDecoders
  53. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  54. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  55. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  56. implicit def offsetDateTimeConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, OffsetDateTime]
    Definition Classes
    JavaTimeConfigDecoders
  57. implicit def offsetTimeConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, OffsetTime]
    Definition Classes
    JavaTimeConfigDecoders
  58. implicit def optionConfigDecoder[A, B](implicit decoder: ConfigDecoder[A, B]): ConfigDecoder[A, Option[B]]
    Definition Classes
    DerivedConfigDecoders
  59. implicit val pathConfigDecoder: ConfigDecoder[String, Path]
    Definition Classes
    JavaNioFileConfigDecoders
  60. implicit val periodConfigDecoder: ConfigDecoder[String, Period]
    Definition Classes
    JavaTimeConfigDecoders
  61. implicit val regexConfigDecoder: ConfigDecoder[String, Regex]
    Definition Classes
    ScalaUtilConfigDecoders
  62. implicit val regexPatternConfigDecoder: ConfigDecoder[String, Pattern]
    Definition Classes
    JavaUtilConfigDecoders
  63. implicit val resolverStyleConfigDecoder: ConfigDecoder[String, ResolverStyle]
    Definition Classes
    JavaTimeConfigDecoders
  64. implicit def secretConfigDecoder[A, B](implicit decoder: ConfigDecoder[A, B]): ConfigDecoder[A, Secret[B]]
    Definition Classes
    CirisConfigDecoders
  65. implicit val shortConfigDecoder: ConfigDecoder[String, Short]
    Definition Classes
    PrimitiveConfigDecoders
  66. implicit val signStyleConfigDecoder: ConfigDecoder[String, SignStyle]
    Definition Classes
    JavaTimeConfigDecoders
  67. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  68. implicit val textStyleConfigDecoder: ConfigDecoder[String, TextStyle]
    Definition Classes
    JavaTimeConfigDecoders
  69. implicit val thaiBuddhistEraConfigDecoder: ConfigDecoder[String, ThaiBuddhistEra]
    Definition Classes
    JavaTimeConfigDecoders
  70. def toString(): String
    Definition Classes
    AnyRef → Any
  71. implicit val uriConfigDecoder: ConfigDecoder[String, URI]
    Definition Classes
    JavaNetConfigDecoders
  72. implicit val urlConfigDecoder: ConfigDecoder[String, URL]
    Definition Classes
    JavaNetConfigDecoders
  73. implicit val uuidConfigDecoder: ConfigDecoder[String, UUID]
    Definition Classes
    JavaUtilConfigDecoders
  74. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  77. implicit def yearConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, Year]
    Definition Classes
    JavaTimeConfigDecoders
  78. implicit def yearMonthConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, YearMonth]
    Definition Classes
    JavaTimeConfigDecoders
  79. implicit val zoneIdConfigDecoder: ConfigDecoder[String, ZoneId]
    Definition Classes
    JavaTimeConfigDecoders
  80. implicit val zoneOffsetConfigDecoder: ConfigDecoder[String, ZoneOffset]
    Definition Classes
    JavaTimeConfigDecoders
  81. implicit def zonedDateTimeConfigDecoder(implicit format: DateTimeFormatter = null): ConfigDecoder[String, ZonedDateTime]
    Definition Classes
    JavaTimeConfigDecoders

Inherited from ConfigDecoders

Inherited from ScalaUtilConfigDecoders

Inherited from PrimitiveConfigDecoders

Inherited from MathConfigDecoders

Inherited from JavaUtilConfigDecoders

Inherited from JavaTimeConfigDecoders

Inherited from JavaNioFileConfigDecoders

Inherited from JavaNetConfigDecoders

Inherited from JavaIoConfigDecoders

Inherited from DurationConfigDecoders

Inherited from DerivedConfigDecoders

Inherited from CirisConfigDecoders

Inherited from AnyRef

Inherited from Any

Ungrouped