configurator works so far

This commit is contained in:
kento2 2026-08-29 19:22:55 +02:00
parent 0cf84f5419
commit 812a1b1b21
25 changed files with 424 additions and 124 deletions

View file

@ -12,6 +12,7 @@ shared_deps = [
artifact("net.kyori:adventure-text-minimessage"),
artifact("org.jdbi:jdbi3-core"),
artifact("org.mongodb:bson"),
artifact("com.google.code.gson:gson"),
]
java_library(

View file

@ -0,0 +1,22 @@
package de.kentoj.scrowlib.utils;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
/**
* @param <V> type of data
*/
public interface Serializer<V> {
JsonElement serialize(V value);
V deserialize(JsonElement json);
default String toJson(V value) {
return serialize(value).toString();
}
default V fromJson(String json) {
return deserialize(JsonParser.parseString(json));
}
}