CNF-02 is a library that provides immutable configuration for Typesafe Config for projects using Java. Typesafe Config will be converted to CNF-01's Configuration interface, so it is wise to read through its documentation as well. CNF-02 has CNF-01 as a dependency, so it provides all the functionality that it has.
The goal is to have CNF-02 as an extension of CNF-01 with the added third party dependency of Typesafe Config. This ensures that if a project does not use Typesafe for configuration, it doesn’t have to be added as a dependency when migrating to use the CNF-01 library.
-
Converts Typesafe Config to CNF-01 interface.
-
Provides all functionalities from CNF-01 with a transitive dependency to the component.
CNF-01’s interface converts to a String to String map of configurations. For this reason, Lists used in Typesafe Config are represented as Strings. The resulting List Strings are in Json format and can be parsed with Jakarta or Gson for example.
Maps are represented individually as key-value pairs like in Typesafe Config.
Null values are not supported. Keys that have null values are not present in the resulting Map.
See CNF-01’s documentation for using the library.
Example for using TypesafeConfiguration
:
// One way of initializing Typesafe Config
Config config = ConfigFactory.parseFile("file/path");
// Converting Config to CNF-01 Map.
Configuration configuration = new TypesafeConfiguration(config);
Map<String, String> configurationMap = configuration.asMap();
You can involve yourself with our project by opening an issue or submitting a pull request.
Contribution requirements:
-
All changes must be accompanied by a new or changed test. If you think testing is not required in your pull request, include a sufficient explanation as why you think so.
-
Security checks must pass
-
Pull requests must align with the principles and values of extreme programming.
-
Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).
Read more in our Contributing Guideline.
Contributors must sign Teragrep Contributor License Agreement before a pull request is accepted to organization’s repositories.
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep’s repositories.