Configuration properties
A set of simple objects for reading configuration
Quick start
Add Maven dependency
<dependency>
<groupId>com.github.skapral.config</groupId>
<artifactId>config-properties</artifactId>
<version>x.y.z</version>
</dependency>
Examples
- Hardcoded HTTP port:
ConfigProperty port = new CpStatic(
"8080"
);
- HTTP port, read from PORT environment value:
ConfigProperty port = new CpEnvironment(
"PORT"
);
- HTTP port, read from PORT environment variable (default 5000 if there is no environment variable):
ConfigProperty port = new CpOneOf(
new CpEnvironment(
"PORT"
),
new CpStatic(
"8080"
)
);