A Kotlin library for parsing configuration values from multiple sources with type-safe field definitions.
implementation("org.dxworks.utils:argumenthor:1.0.0")implementation 'org.dxworks.utils:argumenthor:1.0.0'<dependency>
<groupId>org.dxworks.utils</groupId>
<artifactId>argumenthor</artifactId>
<version>1.0.0</version>
</dependency>- Multi-source configuration - Read values from command-line arguments, properties files, and environment variables
- Type-safe fields - Generic field definitions with compile-time type safety
- Priority-based fallback - Values are looked up across sources in configurable order
- Pluggable architecture - Add custom sources by implementing
ConfigurationSource
// Set up default sources (Args > Properties > Env)
ArgumenthorConfiguration.setDefaultSources()
// Register a field
val portField = NumberField("port")
ArgumenthorConfiguration.registerField(portField)
// Get value (checks all sources in priority order)
val port: Number? = Argumenthor.getValue("port")
// Or get from a specific source
val portFromEnv: Number? = Argumenthor.getValue("port", "env")- ArgsSource - Parses
-argName=valueformat from command-line arguments - PropertiesSource - Loads values from Java properties files
- EnvSource - Reads environment variables with optional prefix
StringField- Basic stringsNumberField- Numeric valuesStringListField- Comma-separated string listsNumberListField- Comma-separated number lists
Apache License 2.0