configur8 alternatives and similar libraries
Based on the "Configuration" category.
Alternatively, view Configur8 alternatives based on common mentions on social networks and blogs.
-
Hoplite
A boilerplate-free Kotlin config library for loading configuration files as data classes -
dotenv-kotlin
🗝️ Dotenv is a module that loads environment variables from a .env file -
konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats -
kaconf
KickAss Configuration. An annotation-based configuration system for Java and Kotlin -
properlty
Simple Kotlin and Java configuration library with recursive placeholders resolution and zero magic!
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of configur8 or a related project?
Popular Comparisons
README
Configur8
Nano-library which provides the ability to define typesafe (!) Configuration templates for applications.
Concept:
A Configuration
is a set of named and typed Property
instances, which are defined using a ConfigurationTemplate
.
Each defined Property can be set with a default value, or be blank with a requirement to be overridden. At runtime, the template is reified
into a concrete Configuration
object, but if any properties are missing this process will throw a Misconfiguration
error.
Assuming that the reification process is successful, property values can be retrieved in an (actually) type-safe manner, and are applied in the following descending order of precedence:
- JVM system property
- Named environment property
- Default value
Quick example
This is from the Kotlin version, but the Scala and Java APIs are broadly the same:
// simple typed values
val USER = Property.string("USER")
val AGE = Property.int("AGE")
// provide custom mapping functions to convert from strings to domain
val PATIENCE_LEVEL = Property("DURATION", { i: String -> Duration.parse(i) }, { it.describe() })
// build your template
val configTemplate = ConfigurationTemplate()
.requiring(USER) // will be supplied by the environment
.withProp(AGE, 2) // falls back to a default typed value
.withProp(PATIENCE_LEVEL, Duration(10)) // custom typed property with default
// attempting to build a configuration with missing values will fail with a Misconfiguration exception
val config = configTemplate.reify()
// retrieval of values in a typesafe way
val patience: Duration = config.valueOf[PATIENCE_LEVEL]
Get it:
Currently, the library is published in Java, Kotlin and Scala versions in JCenter (and synced to Maven Central).
Maven:
Java:
<dependency>
<groupId>io.github.daviddenton</groupId>
<artifactId>configur8</artifactId>
<version>1.7.0</version>
</dependency>
Kotlin:
<dependency>
<groupId>io.github.daviddenton</groupId>
<artifactId>konfigur8</artifactId>
<version>1.7.0</version>
</dependency>
SBT:
libraryDependencies += "io.github.daviddenton" %% "configur8" % "1.7.0"