refactoring and code cleanup
All checks were successful
Build / build (push) Successful in 1m27s

This commit is contained in:
unurled 2024-02-29 15:44:28 +01:00
parent 7cc9395cbc
commit 1380e7479a
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
11 changed files with 45 additions and 77 deletions

View file

@ -2,11 +2,9 @@ package me.unurled.sacredrealms.sr.data;
import static me.unurled.sacredrealms.sr.utils.Logger.error;
import com.google.gson.Gson;
import me.unurled.sacredrealms.sr.SR;
import org.jetbrains.annotations.NotNull;
import redis.clients.jedis.JedisPooled;
import redis.clients.jedis.json.Path2;
public class Redis implements DataHandler {
@ -41,17 +39,6 @@ public class Redis implements DataHandler {
return client.get(key);
}
/**
* Get a value from the data source
*
* @param key The key to get the value from
* @return The value of the key
*/
@Override
public Object getGson(@NotNull String key) {
return client.jsonGet(key);
}
/**
* Set a value in the data source
*
@ -63,28 +50,6 @@ public class Redis implements DataHandler {
client.set(key, value);
}
/**
* Set a value in the data source
*
* @param key The key to set the value to
* @param value The value to set
*/
public void set(@NotNull String key, Gson value) {
client.jsonSet(key, value);
}
/**
* Append a value to the data source
*
* @param key The key to append the value to
* @param path The path to append the value to
* @param json The json to append
*/
@Override
public void jsonAppend(@NotNull String key, @NotNull String path, @NotNull Object... json) {
client.jsonArrAppend(key, Path2.of(path), json);
}
/**
* Remove a value from the data source
*