https://github.com/termermc/tconfig
Small, simple library to convert configuration files to and from Map objects
https://github.com/termermc/tconfig
config hashmap java map simple
Last synced: 3 months ago
JSON representation
Small, simple library to convert configuration files to and from Map objects
- Host: GitHub
- URL: https://github.com/termermc/tconfig
- Owner: termermc
- License: gpl-3.0
- Created: 2018-05-13T19:41:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-17T06:11:59.000Z (over 6 years ago)
- Last Synced: 2025-02-06T09:48:36.827Z (4 months ago)
- Topics: config, hashmap, java, map, simple
- Language: Java
- Size: 27.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tConfig
Small, simple library to convert configuration files to and from Map objects## Features
- Convert config files to and from HashMap objects
- Edit, add, and delete config files' values and fields directly## Code Snippets
To parse a config file into a HashMap:
```java
// HashMap to put the config file's contents into
HashMap configContent = null;// Parse the config
// Arg 1 - the file to parse
// Arg 2 - the separating String between fields and values, e.g. ":" for "field: value"
// Arg 3 - the comment String to ignore, e.g. "#" for "# This is a comment!"
configContent = tConfig.parseConfig(new File("myconfig.ini"), ":", "#")
```To convert a HashMap to a config file:
```java
// HashMap to convert to a config file
HashMap myMap = new HashMap();
myMap.put("field", "value");// Convert the HashMap
tConfig.createConfig(new File("myconfig.ini"), myMap, ":");
```## Javadoc
Javadocs are available [here](https://termer.net/javadocs/tconfig/).