cfg4k alternatives and similar libraries
Based on the "Configuration" category.
Alternatively, view cfg4k 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! -
configur8
Nano-library which provides the ability to define typesafe (!) configuration templates for applications.
Appwrite - The Open Source Firebase alternative introduces iOS support
* 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 cfg4k or a related project?
Popular Comparisons
README
Overview
Cfg4k is a configuration library made for Kotlin in Kotlin!
Features
- Automatic reload
- Interface binding
- Ability to handle data classes automatically
- All the complex types and generics are supported
- Huge flexibility, custom sources
- Easy to use
- Bytebuddy provider will be able to compile your bindings at runtime (You will need to add the cfg4k-bytebuddy to your dependencies.)
For further information, use the wiki
Quick start
Add the Bintray repository:
repositories { jcenter() }
Add the dependency for the module(s) that you are going to use
compile 'com.jdiazcano.cfg4k:cfg4k-core:$VERSION'
fun main(args: Array<String>) {
val source = ClassPathConfigSource("global.properties") // Create source
val loader = PropertyConfigLoader(source) // Create loader
val provider = ProxyConfigProvider(loader) // Create provider
val databaseConfig = provider.bind<DatabaseConfig>("database") // bind and use
println("Name: ${databaseConfig.name()}")
println("Url: ${databaseConfig.url()}")
println("Port: ${databaseConfig.port()}")
}
/**
* This interface defines a database configuration
*/
interface DatabaseConfig {
/**
* You can have javadocs inside your properties and this is really cool
*/
fun url(): String
fun port(): Int
fun name(): String
// if you have an unused property you know it and you can delete it
val unused: String
@Deprecated("You can even deprecate properties!")
fun deprecated(): Boolean
val youCanuseValuesToo: String
val andNullables: Int?
}
Architeture overview
License
Licensed under the Apache License, Version 2.0. See LICENSE file.
*Note that all licence references and agreements mentioned in the cfg4k README section above
are relevant to that project's source code only.