Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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"
}
```