Overview of Config library features
mainThe Config library is a plain Java implementation with no dependencies that provides the following capabilities:
- Supported Formats: Java properties, JSON, and HOCON (a human-friendly JSON superset).
- Loading: Supports loading from files, URLs, or the classpath.
- Merging: Merges multiple files across all supported formats.
- Overrides: Users can override configuration using Java system properties (e.g.,
java -Dmyapp.foo.bar=10). - Type Conversion: Automatically converts types (e.g., string "yes" to boolean, or int to float).
- Special Parsers: Parses duration and size settings (e.g., "512k" or "10 seconds").
- HOCON Features: Supports comments, includes, substitutions (
${bar}), and environment variable substitution (logdir=${HOME}/logs). - Immutability: Uses immutable
Configinstances for thread safety and predictable transformations.