pureconfig
package pureconfig
- Alphabetic
- By Inheritance
- pureconfig
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait BasicReaders extends PrimitiveReaders with JavaEnumReader with UriAndPathReaders with RegexReaders with JavaTimeReaders with DurationReaders with NumericReaders with TypesafeConfigReaders
Trait containing
ConfigReader
instances for primitive types and simple classes in Java and Scala standard libraries. - trait BasicWriters extends PrimitiveWriters with JavaEnumWriter with UriAndPathWriters with RegexWriters with JavaTimeWriters with DurationWriters with NumericWriters with TypesafeConfigWriters
Trait containing
ConfigWriter
instances for primitive types and simple classes in Java and Scala standard libraries. - trait CapitalizedWordsNamingConvention extends NamingConvention
- trait CollectionReaders extends AnyRef
Trait containing
ConfigReader
instances for collection types. - trait CollectionWriters extends AnyRef
Trait containing
ConfigWriter
instances for collection types. - trait ConfigConvert[A] extends ConfigReader[A] with ConfigWriter[A]
Trait for objects capable of reading and writing objects of a given type from and to
ConfigValues
. - sealed trait ConfigCursor extends AnyRef
A wrapper for a
ConfigValue
providing safe navigation through the config and holding positional data for better error handling. - trait ConfigFieldMapping extends (String) => String
A mapping between case class fields and their respective keys in the config.
- case class ConfigListCursor(value: ConfigList, pathElems: List[String], offset: Int = 0) extends ConfigCursor with Product with Serializable
A
ConfigCursor
pointing to a config list. - case class ConfigObjectCursor(value: ConfigObject, pathElems: List[String]) extends ConfigCursor with Product with Serializable
A
ConfigCursor
pointing to a config object. - final class ConfigObjectSource extends ConfigSource
A
ConfigSource
which is guaranteed to generate config objects (maps) as root values. - trait ConfigReader[A] extends AnyRef
Trait for objects capable of reading objects of a given type from
ConfigValues
.Trait for objects capable of reading objects of a given type from
ConfigValues
.- A
the type of objects readable by this
ConfigReader
- trait ConfigSource extends AnyRef
A representation of a source from which
ConfigValue
s can be loaded, such as a file or a URL.A representation of a source from which
ConfigValue
s can be loaded, such as a file or a URL.A source allows users to load configs from this source as any type for which a
ConfigReader
is available. Raw configs can also be retrieved as aConfigValue
, aConfigCursor
or aFluentConfigCursor
. Before using any of the loading methods described, Users can opt to focus on a specific part of a config by specifying a namespace.All config loading methods are lazy and defer resolution of references until needed.
- trait ConfigWriter[A] extends AnyRef
Trait for objects capable of writing objects of a given type to
ConfigValues
.Trait for objects capable of writing objects of a given type to
ConfigValues
.- A
the type of objects writable by this
ConfigWriter
- trait ConvertHelpers extends AnyRef
Useful helpers for building
ConfigConvert
instances and dealing with results. - trait DurationReaders extends AnyRef
Trait containing
ConfigReader
instances for scala.concurrent.duration.Duration and scala.concurrent.duration.FiniteDuration. - trait DurationWriters extends AnyRef
Trait containing
ConfigWriter
instances for scala.concurrent.duration.Duration and scala.concurrent.duration.FiniteDuration. - final case class Exported[A](instance: A) extends AnyVal with Product with Serializable
A wrapper for type class instances intended to allow implicits in scope by
import
statements to have lower priority than implicits in the relevant companion objects.A wrapper for type class instances intended to allow implicits in scope by
import
statements to have lower priority than implicits in the relevant companion objects. This behavior requires type classes to provide a bridge in their companion objects, as done byConfigReader
(see pureconfig.ExportedReaders) andConfigWriter
(see pureconfig.ExportedWriters).- A
the type class
- instance
the type class instance to wrap
- trait ExportedReaders extends AnyRef
Trait allowing
ConfigReader
instances exported viaExported
to be used.Trait allowing
ConfigReader
instances exported viaExported
to be used.This trait should be the last to be mixed into
ConfigReader
's companion object so that exported readers will always have lower precedence thanConfigReader
instances exposed as implicits through the usual means. - trait ExportedWriters extends AnyRef
Trait allowing
ConfigWriter
instances exported viaExported
to be used.Trait allowing
ConfigWriter
instances exported viaExported
to be used.This trait should be the last to be mixed into
ConfigWriter
's companion object so that exported writers will always have lower precedence thanConfigWriter
instances exposed as implicits through the usual means. - trait FactoryCompat[-A, +C] extends AnyRef
A compatibility layer for creating
CanBuildFrom
-like generic methods that work both on Scala 2.13 and pre-2.13 versions.A compatibility layer for creating
CanBuildFrom
-like generic methods that work both on Scala 2.13 and pre-2.13 versions.- A
the type of elements that get added to the builder
- C
the type of collection that it produces
- case class FluentConfigCursor(cursor: Result[ConfigCursor]) extends Product with Serializable
A version of
ConfigCursor
with a more fluent interface, focused on config navigation instead of error handling.A version of
ConfigCursor
with a more fluent interface, focused on config navigation instead of error handling.The
at
method, used to access object and list values, is available without a previous need to cast the cursor and always returns another cursor instead of aConfigReader.Result
. The error handling is left for the last step, where users can opt to cast to a primitive value using one of theas
methods or by requesting a regular cursor withcursor
.- cursor
the regular cursor pointed to by this object, wrapped itself into a
Right
, or aLeft
with a list of failures in case an error occurred during navigation
- trait JavaEnumReader extends AnyRef
Trait containing
ConfigReader
instance for Java Enums. - trait JavaEnumWriter extends AnyRef
Trait containing instance for
ConfigWriter
for Java Enum. - trait JavaTimeReaders extends AnyRef
Trait containing
ConfigReader
instances forjava.time
classes. - trait JavaTimeWriters extends AnyRef
Trait containing
ConfigWriter
instances forjava.time
classes. - trait NamingConvention extends AnyRef
- trait NumericReaders extends AnyRef
Trait containing
ConfigReader
instances for Java and Scala arbitrary-precision numeric types. - trait NumericWriters extends AnyRef
Trait containing
ConfigWriter
instances for Java and Scala arbitrary-precision numeric types. - sealed trait PathSegment extends Product with Serializable
- trait PrimitiveReaders extends AnyRef
Trait containing
ConfigReader
instances for primitive types. - trait PrimitiveWriters extends AnyRef
Trait containing
ConfigWriter
instances for primitive types. - trait ProductReaders extends AnyRef
- trait ProductWriters extends AnyRef
- trait ReadsMissingKeys extends AnyRef
A marker trait signaling that a
ConfigReader
accepts missing (undefined) values.A marker trait signaling that a
ConfigReader
accepts missing (undefined) values.The standard behavior of
ConfigReader
s that expect required keys in config objects is to return aKeyNotFound
failure when one or more of them are missing. Mixing in this trait into the key'sConfigReader
signals that if a value is missing for the key, theConfigReader
can be called with a cursor in the "undefined" state. - trait RegexReaders extends AnyRef
Trait containing
ConfigReader
instances for classes related to regular expressions. - trait RegexWriters extends AnyRef
Trait containing
ConfigWriter
instances for classes related to regular expressions. - case class SimpleConfigCursor(value: ConfigValue, pathElems: List[String]) extends ConfigCursor with Product with Serializable
A simple
ConfigCursor
providing no extra operations. - class StringDelimitedNamingConvention extends NamingConvention
- trait TypesafeConfigReaders extends AnyRef
Trait containing
ConfigReader
instances for Typesafe config models. - trait TypesafeConfigWriters extends AnyRef
Trait containing
ConfigWriter
instances for Typesafe config models. - trait UriAndPathReaders extends AnyRef
Trait containing
ConfigReader
instances for classes related to file system paths and URIs. - trait UriAndPathWriters extends AnyRef
Trait containing
ConfigWriter
instances for classes related to file system paths and URIs. - trait WritesMissingKeys[A] extends AnyRef
A trait signaling that a
ConfigWriter
can write missing (undefined) values.A trait signaling that a
ConfigWriter
can write missing (undefined) values.ConfigWriter
s always produce a validConfigValue
with theirto
method. This trait adds an extratoOpt
method that parent writers can use in order to decide whether or not they should write a value using this writer.
Value Members
- def saveConfigAsPropertyFile[Config](conf: Config, outputPath: Path, overrideOutputPath: Boolean = false, options: ConfigRenderOptions = ConfigRenderOptions.defaults())(implicit writer: Derivation[ConfigWriter[Config]]): Unit
Save the given configuration into a property file
Save the given configuration into a property file
- conf
The configuration to save
- outputPath
Where to write the configuration
- overrideOutputPath
Override the path if it already exists
- options
the config rendering options
- Annotations
- @throws(scala.this.throws.<init>$default$1[IllegalArgumentException])
- def saveConfigToStream[Config](conf: Config, outputStream: OutputStream, options: ConfigRenderOptions = ConfigRenderOptions.defaults())(implicit writer: Derivation[ConfigWriter[Config]]): Unit
Writes the configuration to the output stream and closes the stream
Writes the configuration to the output stream and closes the stream
- conf
The configuration to write
- outputStream
The stream in which the configuration should be written
- options
the config rendering options
- object BasicReaders extends BasicReaders
- object BasicWriters extends BasicWriters
- object CamelCase extends CapitalizedWordsNamingConvention
CamelCase identifiers look like
camelCase
anduseMorePureconfig
CamelCase identifiers look like
camelCase
anduseMorePureconfig
- See also
https://en.wikipedia.org/wiki/Camel_case
- object CapitalizedWordsNamingConvention
- object CollectionReaders extends CollectionReaders
- object CollectionWriters extends CollectionWriters
- object ConfigConvert extends ConvertHelpers
Provides methods to create ConfigConvert instances.
- object ConfigCursor
- object ConfigFieldMapping
- object ConfigObjectSource
- object ConfigReader extends BasicReaders with CollectionReaders with ProductReaders with ExportedReaders
Provides methods to create ConfigReader instances.
- object ConfigSource
Object containing factory methods for building
ConfigSource
s.Object containing factory methods for building
ConfigSource
s.The sources provided here use Typesafe Config configs created from files, resources, URLs or strings. It also provides sources that delegate the loading component to Typesafe Config, to leverage reference configs and overrides, making it easy to switch from using
ConfigFactory
toConfigSource
.Other PureConfig modules may provide other ways or building config sources (e.g. for different config formats or data sources).
- object ConfigWriter extends BasicWriters with CollectionWriters with ProductWriters with ExportedWriters
Provides methods to create ConfigWriter instances.
- object ConvertHelpers extends ConvertHelpers
- object ExportedReaders extends ExportedReaders
- object ExportedWriters extends ExportedWriters
- object FactoryCompat
- object KebabCase extends StringDelimitedNamingConvention
KebabCase identifiers look like
kebab-case
anduse-more-pureconfig
KebabCase identifiers look like
kebab-case
anduse-more-pureconfig
- See also
http://wiki.c2.com/?KebabCase
- object PascalCase extends CapitalizedWordsNamingConvention
PascalCase identifiers look like e.g.
PascalCase
andUseMorePureconfig
PascalCase identifiers look like e.g.
PascalCase
andUseMorePureconfig
- See also
https://en.wikipedia.org/wiki/PascalCase
- object PathSegment extends Serializable
- object ProductReaders extends ProductReaders
- object ProductWriters extends ProductWriters
- object SnakeCase extends StringDelimitedNamingConvention
SnakeCase identifiers look like
snake_case
anduse_more_pureconfig
SnakeCase identifiers look like
snake_case
anduse_more_pureconfig
- See also
https://en.wikipedia.org/wiki/Snake_case
Deprecated Value Members
- def loadConfig[Config](conf: Config, namespace: String)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the givenConfig
Load a configuration of type
Config
from the givenConfig
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).at(namespace).load[Config]
instead
- def loadConfig[Config](conf: Config)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the givenConfig
Load a configuration of type
Config
from the givenConfig
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).load[Config]
instead
- def loadConfig[Config](path: Path, namespace: String)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the given file.Load a configuration of type
Config
from the given file. Note that standard configuration files are still loaded but can be overridden from the given configuration file- namespace
the base namespace from which the configuration should be load
- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).at(namespace).load[Config]
instead
- def loadConfig[Config](path: Path)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the given file.Load a configuration of type
Config
from the given file. Note that standard configuration files are still loaded but can be overridden from the given configuration file- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).load[Config]
instead
- def loadConfig[Config](namespace: String)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the standard configuration filesLoad a configuration of type
Config
from the standard configuration files- namespace
the base namespace from which the configuration should be load
- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.at(namespace).load[Config]
instead
- def loadConfig[Config](implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the standard configuration filesLoad a configuration of type
Config
from the standard configuration files- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.load[Config]
instead
- def loadConfigFromFiles[Config](files: Traversable[Path], failOnReadError: Boolean = false, namespace: String = "")(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Loads
files
in order, allowing values in later files to backstop missing values from prior, and converts them into aConfig
.Loads
files
in order, allowing values in later files to backstop missing values from prior, and converts them into aConfig
.This is a convenience method which enables having default configuration which backstops local configuration.
The behavior of the method if an element of
files
references a file which doesn't exist or can't be read is defined by thefailOnReadError
flag. WithfailOnReadError = false
, such files will silently be ignored while otherwise they would yield a failure (aLeft
value).- files
Files ordered in decreasing priority containing part or all of a
Config
- failOnReadError
Where to return an error if any files fail to read
- namespace
the base namespace from which the configuration should be load
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Construct a custom
ConfigSource
pipeline instead
- def loadConfigFromFilesOrThrow[Config](files: Traversable[Path])(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Construct a custom
ConfigSource
pipeline instead- See also
- def loadConfigOrThrow[Config](conf: Config, namespace: String)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the givenConfig
Load a configuration of type
Config
from the givenConfig
- conf
Typesafe configuration to load
- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).at(namespace).loadOrThrow[Config]
instead
- def loadConfigOrThrow[Config](conf: Config)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the givenConfig
Load a configuration of type
Config
from the givenConfig
- conf
Typesafe configuration to load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).loadOrThrow[Config]
instead
- def loadConfigOrThrow[Config](path: Path, namespace: String)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the given file.Load a configuration of type
Config
from the given file. Note that standard configuration files are still loaded but can be overridden from the given configuration file- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).at(namespace).loadOrThrow[Config]
instead
- def loadConfigOrThrow[Config](path: Path)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the given file.Load a configuration of type
Config
from the given file. Note that standard configuration files are still loaded but can be overridden from the given configuration file- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).loadOrThrow[Config]
instead
- def loadConfigOrThrow[Config](namespace: String)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the standard configuration filesLoad a configuration of type
Config
from the standard configuration files- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.at(namespace).loadOrThrow[Config]
instead
- def loadConfigOrThrow[Config](implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the standard configuration filesLoad a configuration of type
Config
from the standard configuration files- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.loadOrThrow[Config]
instead
- def loadConfigWithFallback[Config](conf: Config, namespace: String)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the givenConfig
, falling back to the default configurationLoad a configuration of type
Config
from the givenConfig
, falling back to the default configuration- conf
Typesafe configuration to load
- namespace
the base namespace from which the configuration should be load
- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).at(namespace).load[Config]
instead
- def loadConfigWithFallback[Config](conf: Config)(implicit reader: Derivation[ConfigReader[Config]]): Result[Config]
Load a configuration of type
Config
from the givenConfig
, falling back to the default configurationLoad a configuration of type
Config
from the givenConfig
, falling back to the default configuration- conf
Typesafe configuration to load
- returns
A
Success
with the configuration if it is possible to create an instance of typeConfig
from the configuration files, else aFailure
with details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).load[Config]
instead
- def loadConfigWithFallbackOrThrow[Config](conf: Config, namespace: String)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the givenConfig
, falling back to the default configurationLoad a configuration of type
Config
from the givenConfig
, falling back to the default configuration- conf
Typesafe configuration to load
- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).at(namespace).loadOrThrow[Config]
instead
- def loadConfigWithFallbackOrThrow[Config](conf: Config)(implicit arg0: ClassTag[Config], reader: Derivation[ConfigReader[Config]]): Config
Load a configuration of type
Config
from the givenConfig
, falling back to the default configurationLoad a configuration of type
Config
from the givenConfig
, falling back to the default configuration- conf
Typesafe configuration to load
- returns
the configuration
- Annotations
- @throws(scala.this.throws.<init>$default$1[pureconfig.error.ConfigReaderException[_]]) @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).loadOrThrow[Config]
instead