Hello, world!
This tiny API is worth taking a look.
Features
- π’ No Redundancy
- πΌ Easily Handles multiple references of same Storage
- π€ Real-Time Write i.e Automatically Saves file on changes
- π Auto constructs the entire path
- π Usable with Java CLI and any GUI framework
Example:
public class Preferences {
public static void save(){
HashMap<String, Integer> map = new HashMap<>();
map.put("Simon", 99);
map.put("Alex", 96);
map.put("Sofia", 89);
DataStorage storage = DataStorage.getStorage(".config", "settings.json");
storage.put("students", map); // Auto-Save
System.out.println(storage.query("students", "Simon"));
// Displays 99
DataStorage storage2 = DataStorage.getStorage(".config", "settings.json");
storage2.put("teachers", 18); // Auto-Save
// storage2 is the same storage object with no object redundancy π
}
public static void main(String[] args) {
save();
}
}
Top comments (0)