Built-in Supported Types
PureConfig comes with baked-in support for many types, most of them from the standard Java and Scala libraries. When using those types, users don’t have to provide anything else in order to be able to load a config.
The currently supported basic types are:
Double(standard and percentage format ending with
Float(also supporting percentage),
- everything in
java.time(must be configured first - see Configurable Converters);
- value classes (for which readers and writers of the inner type are directly used).
Additionally, PureConfig also handles the following collections and composite Scala structures:
Optionfor optional values, i.e. values that can or cannot be in the configuration, of types on this list;
- collections implementing the
TraversableOncetrait, where the type of the elements is on this list;
Stringkeys to any value type that is on this list;
Maps from types convertible to
Stringto any value type that is on this list (must be configured first - see Configurable Converters);
shapeless.HLists of elements whose type is on this list;
- case classes;
- classes with only public
varparameters in their constructor;
- sealed families of case classes (ADTs).
The support for these types already covers most simple cases, such as the one shown in Quick Start. See Supporting New Types to see how to support types that are not on those lists and Overriding Behavior for Types to change how PureConfig reads the built-in types above.