Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cefoler/configuration
Framework for JSON, YAML, TOML and PROPERTIES configuration.
https://github.com/cefoler/configuration
configuration jackson java json properties toml yaml
Last synced: 4 days ago
JSON representation
Framework for JSON, YAML, TOML and PROPERTIES configuration.
- Host: GitHub
- URL: https://github.com/cefoler/configuration
- Owner: cefoler
- License: apache-2.0
- Created: 2021-03-29T16:24:07.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T06:01:04.000Z (almost 2 years ago)
- Last Synced: 2023-06-30T01:01:27.521Z (over 1 year ago)
- Topics: configuration, jackson, java, json, properties, toml, yaml
- Language: Java
- Homepage:
- Size: 471 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Configuration
A Configuration wrapper for **Json**, **Yaml**, **Toml** and **Properties**, it uses **Jackson** as
it's mainly reader ensuring the dependency is light-weight and performance.## How to use
Want to take a look how easily you can create a new configuration? Take a look below:
```
final Configuration configuration = ConfigurationFactory.start(
ConfigurationType.DRIVER,
"PATH",
"RESOURCE",
false
);
```For the **DRIVER** value, you must use the **JSON**, **YAML**, **TOML** and **PROPERTIES** type
from the ConfigurationType enum.
For the **PATH** value, you must use the file's destination path.
For the **RESOURCE** value, you must use the path of the internal configuration file.## Replace
Want to use universal replaces to when you get or set a value at the configuration?
Our ReplaceValue is here to help you!```
final ReplaceValue replace = ReplaceValue.builder()
.value(VALUE_TO_BE_REPLACED)
.type(ReplaceType.TYPE_OF_SUBSTITUTE)
.build();configuration.addReplacer(VALUE_TO_REPLACE, replace);
```For the **VALUE_TO_BE_REPLACED** value, you must use the value that will be replaced.
For the **TYPE_OF_SUBSTITUTE** value, you can use the **ALL**, **GET** and **SET** type
from the ReplaceType enum.
For the **VALUE_TO_REPLACE** value, you must use the value that will be the replacement.Have more questions? Feel free to create a issue and help us out!
## How to install
### Maven
```
com.cefoler.configuration
configuration
VERSION```
### Gradle
```
dependencies {
implementation "com.cefoler.configuration:configuration:VERSION"
}
```