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
ConfigReaderinstances 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
ConfigWriterinstances for primitive types and simple classes in Java and Scala standard libraries. - trait CapitalizedWordsNamingConvention extends NamingConvention
- trait CollectionReaders extends AnyRef
Trait containing
ConfigReaderinstances for collection types. - trait CollectionWriters extends AnyRef
Trait containing
ConfigWriterinstances 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
ConfigValueproviding 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(listValue: ConfigList, pathElems: List[String], offset: Int = 0) extends ConfigCursor with Product with Serializable
A
ConfigCursorpointing to a config list. - case class ConfigObjectCursor(objValue: ConfigObject, pathElems: List[String]) extends ConfigCursor with Product with Serializable
A
ConfigCursorpointing to a config object. - final class ConfigObjectSource extends ConfigSource
A
ConfigSourcewhich 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
ConfigValues can be loaded, such as a file or a URL.A representation of a source from which
ConfigValues 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
ConfigReaderis available. Raw configs can also be retrieved as aConfigValue, aConfigCursoror 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
ConfigConvertinstances and dealing with results. - trait DurationReaders extends AnyRef
Trait containing
ConfigReaderinstances forscala.concurrent.duration.Durationand scala.concurrent.duration.FiniteDuration. - trait DurationWriters extends AnyRef
Trait containing
ConfigWriterinstances forscala.concurrent.duration.Durationand 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
importstatements to have lower priority than implicits in the relevant companion objects.A wrapper for type class instances intended to allow implicits in scope by
importstatements 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
ConfigReaderinstances exported viaExportedto be used.Trait allowing
ConfigReaderinstances exported viaExportedto 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 thanConfigReaderinstances exposed as implicits through the usual means. - trait ExportedWriters extends AnyRef
Trait allowing
ConfigWriterinstances exported viaExportedto be used.Trait allowing
ConfigWriterinstances exported viaExportedto 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 thanConfigWriterinstances exposed as implicits through the usual means. - case class FluentConfigCursor(cursor: Result[ConfigCursor]) extends Product with Serializable
A version of
ConfigCursorwith a more fluent interface, focused on config navigation instead of error handling.A version of
ConfigCursorwith a more fluent interface, focused on config navigation instead of error handling.The
atmethod, 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 theasmethods or by requesting a regular cursor withcursor.- cursor
the regular cursor pointed to by this object, wrapped itself into a
Right, or aLeftwith a list of failures in case an error occurred during navigation
- trait JavaEnumReader extends AnyRef
Trait containing
ConfigReaderinstance for Java Enums. - trait JavaEnumWriter extends AnyRef
Trait containing instance for
ConfigWriterfor Java Enum. - trait JavaTimeReaders extends AnyRef
Trait containing
ConfigReaderinstances forjava.timeclasses. - trait JavaTimeWriters extends AnyRef
Trait containing
ConfigWriterinstances forjava.timeclasses. - trait NamingConvention extends AnyRef
- trait NumericReaders extends AnyRef
Trait containing
ConfigReaderinstances for Java and Scala arbitrary-precision numeric types. - trait NumericWriters extends AnyRef
Trait containing
ConfigWriterinstances for Java and Scala arbitrary-precision numeric types. - sealed trait PathSegment extends Product with Serializable
- trait PrimitiveReaders extends AnyRef
Trait containing
ConfigReaderinstances for primitive types. - trait PrimitiveWriters extends AnyRef
Trait containing
ConfigWriterinstances for primitive types. - trait ProductReaders extends AnyRef
- trait ProductWriters extends AnyRef
- trait ReaderDerives extends AnyRef
- trait ReadsMissingKeys extends AnyRef
A marker trait signaling that a
ConfigReaderaccepts missing (undefined) values.A marker trait signaling that a
ConfigReaderaccepts missing (undefined) values.The standard behavior of
ConfigReaders that expect required keys in config objects is to return aKeyNotFoundfailure when one or more of them are missing. Mixing in this trait into the key'sConfigReadersignals that if a value is missing for the key, theConfigReadercan be called with a cursor in the "undefined" state. - trait RegexReaders extends AnyRef
Trait containing
ConfigReaderinstances for classes related to regular expressions. - trait RegexWriters extends AnyRef
Trait containing
ConfigWriterinstances for classes related to regular expressions. - case class SimpleConfigCursor(valueOpt: Option[ConfigValue], pathElems: List[String]) extends ConfigCursor with Product with Serializable
A simple
ConfigCursorproviding no extra operations. - class StringDelimitedNamingConvention extends NamingConvention
- trait TypesafeConfigReaders extends AnyRef
Trait containing
ConfigReaderinstances for Typesafe config models. - trait TypesafeConfigWriters extends AnyRef
Trait containing
ConfigWriterinstances for Typesafe config models. - trait UriAndPathReaders extends AnyRef
Trait containing
ConfigReaderinstances for classes related to file system paths and URIs. - trait UriAndPathWriters extends AnyRef
Trait containing
ConfigWriterinstances for classes related to file system paths and URIs. - trait WritesMissingKeys[A] extends AnyRef
A trait signaling that a
ConfigWritercan write missing (undefined) values.A trait signaling that a
ConfigWritercan write missing (undefined) values.ConfigWriters always produce a validConfigValuewith theirtomethod. This trait adds an extratoOptmethod that parent writers can use in order to decide whether or not they should write a value using this writer.
Value Members
- def saveConfigAsPropertyFile[A](conf: A, outputPath: Path, overrideOutputPath: Boolean = false, options: ConfigRenderOptions = ConfigRenderOptions.defaults())(implicit writer: ConfigWriter[A]): 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("")
- def saveConfigToStream[A](conf: A, outputStream: OutputStream, options: ConfigRenderOptions = ConfigRenderOptions.defaults())(implicit writer: ConfigWriter[A]): 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
camelCaseanduseMorePureconfigCamelCase identifiers look like
camelCaseanduseMorePureconfig- 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 with ReaderDerives
Provides methods to create ConfigReader instances.
- object ConfigSource
Object containing factory methods for building
ConfigSources.Object containing factory methods for building
ConfigSources.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
ConfigFactorytoConfigSource.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 KebabCase extends StringDelimitedNamingConvention
KebabCase identifiers look like
kebab-caseanduse-more-pureconfigKebabCase identifiers look like
kebab-caseanduse-more-pureconfig- See also
http://wiki.c2.com/?KebabCase
- object PascalCase extends CapitalizedWordsNamingConvention
PascalCase identifiers look like e.g.
PascalCaseandUseMorePureconfigPascalCase identifiers look like e.g.
PascalCaseandUseMorePureconfig- See also
https://en.wikipedia.org/wiki/PascalCase
- object PathSegment extends Serializable
- object ProductReaders extends ProductReaders
- object ProductWriters extends ProductWriters
- object ScreamingSnakeCase extends NamingConvention
SnakeCase identifiers look like
SCREAMING_SNAKE_CASEandUSE_MORE_PURECONFIGSnakeCase identifiers look like
SCREAMING_SNAKE_CASEandUSE_MORE_PURECONFIG- See also
https://en.wikipedia.org/wiki/Snake_case (and search for SCREAMING_SNAKE_CASE)
- object SnakeCase extends StringDelimitedNamingConvention
SnakeCase identifiers look like
snake_caseanduse_more_pureconfigSnakeCase identifiers look like
snake_caseanduse_more_pureconfig- See also
https://en.wikipedia.org/wiki/Snake_case
Deprecated Value Members
- def loadConfig[A](conf: Config, namespace: String)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the givenConfigLoad a configuration of type
Afrom the givenConfig- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).at(namespace).load[A]instead
- def loadConfig[A](conf: Config)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the givenConfigLoad a configuration of type
Afrom the givenConfig- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).load[A]instead
- def loadConfig[A](path: Path, namespace: String)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the given file.Load a configuration of type
Afrom 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
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).at(namespace).load[A]instead
- def loadConfig[A](path: Path)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the given file.Load a configuration of type
Afrom the given file. Note that standard configuration files are still loaded but can be overridden from the given configuration file- returns
A
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).load[A]instead
- def loadConfig[A](namespace: String)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the standard configuration filesLoad a configuration of type
Afrom the standard configuration files- namespace
the base namespace from which the configuration should be load
- returns
A
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.at(namespace).load[A]instead
- def loadConfig[A](implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the standard configuration filesLoad a configuration of type
Afrom the standard configuration files- returns
A
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.load[A]instead
- def loadConfigFromFiles[A](files: Traversable[Path], failOnReadError: Boolean = false, namespace: String = "")(implicit reader: ConfigReader[A]): Result[A]
Loads
filesin order, allowing values in later files to backstop missing values from prior, and converts them into aConfig.Loads
filesin 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
filesreferences a file which doesn't exist or can't be read is defined by thefailOnReadErrorflag. WithfailOnReadError = false, such files will silently be ignored while otherwise they would yield a failure (aLeftvalue).- 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
ConfigSourcepipeline instead
- def loadConfigFromFilesOrThrow[A](files: Traversable[Path])(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Construct a custom
ConfigSourcepipeline instead- See also
- def loadConfigOrThrow[A](conf: Config, namespace: String)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the givenConfigLoad a configuration of type
Afrom the givenConfig- conf
Typesafe configuration to load
- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).at(namespace).loadOrThrow[A]instead
- def loadConfigOrThrow[A](conf: Config)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the givenConfigLoad a configuration of type
Afrom the givenConfig- conf
Typesafe configuration to load
- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).loadOrThrow[A]instead
- def loadConfigOrThrow[A](path: Path, namespace: String)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the given file.Load a configuration of type
Afrom 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("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).at(namespace).loadOrThrow[A]instead
- def loadConfigOrThrow[A](path: Path)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the given file.Load a configuration of type
Afrom 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("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default(ConfigSource.file(path)).loadOrThrow[A]instead
- def loadConfigOrThrow[A](namespace: String)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the standard configuration filesLoad a configuration of type
Afrom the standard configuration files- namespace
the base namespace from which the configuration should be load
- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.at(namespace).loadOrThrow[A]instead
- def loadConfigOrThrow[A](implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the standard configuration filesLoad a configuration of type
Afrom the standard configuration files- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.default.loadOrThrow[A]instead
- def loadConfigWithFallback[A](conf: Config, namespace: String)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the givenConfig, falling back to the default configurationLoad a configuration of type
Afrom 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
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith 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[A]instead
- def loadConfigWithFallback[A](conf: Config)(implicit reader: ConfigReader[A]): Result[A]
Load a configuration of type
Afrom the givenConfig, falling back to the default configurationLoad a configuration of type
Afrom the givenConfig, falling back to the default configuration- conf
Typesafe configuration to load
- returns
A
Successwith the configuration if it is possible to create an instance of typeAfrom the configuration files, else aFailurewith details on why it isn't possible
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).load[A]instead
- def loadConfigWithFallbackOrThrow[A](conf: Config, namespace: String)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the givenConfig, falling back to the default configurationLoad a configuration of type
Afrom 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("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).at(namespace).loadOrThrow[A]instead
- def loadConfigWithFallbackOrThrow[A](conf: Config)(implicit arg0: ClassTag[A], reader: ConfigReader[A]): A
Load a configuration of type
Afrom the givenConfig, falling back to the default configurationLoad a configuration of type
Afrom the givenConfig, falling back to the default configuration- conf
Typesafe configuration to load
- returns
the configuration
- Annotations
- @throws("") @deprecated
- Deprecated
(Since version 0.12.0) Use
ConfigSource.fromConfig(conf).withFallback(ConfigSource.default).loadOrThrow[A]instead