The Configuration Foundation (Confound) library provides a lightweight yet powerful model for accessing various types of application configuration facilities via Csar.
Quick Start
System Properties and Environment Variables
1. Include Confound Dependency
Include the latest Confound dependency from Maven. To support system properties and environment variables, simply add io.confound:confound:x.x.x
to your POM.
2. Acquire a Configuration
Acquire a Configuration
instance via Confound
to gain access to configured parameters. You can also implement the mixin interface Confounded
to bring quick and easy configuration to the entire class hierarchy.
3. Access Configured Parameters
Access parameters as required. By default Confound will automatically discover the configured parameter from any of the following sources:
- A system property named
foo.bar
, set for example using-Dfoo.bar=5
. - An environment variable named
FOO_BAR
, set for example usingSET FOO=5
in the shell.