diff --git a/src/main/scala/me/skymc/taboolib/common/serialize/TSerializable.java b/src/main/scala/me/skymc/taboolib/common/serialize/TSerializable.java index 2529adf..63a6fe1 100644 --- a/src/main/scala/me/skymc/taboolib/common/serialize/TSerializable.java +++ b/src/main/scala/me/skymc/taboolib/common/serialize/TSerializable.java @@ -6,12 +6,15 @@ package me.skymc.taboolib.common.serialize; */ public interface TSerializable { - void read(String fieldName, String value); + default void read(String fieldName, String value) { + } - String write(String fieldName, Object value); + default String write(String fieldName, Object value) { + return null; + } - default void read(String value) { - TSerializer.read(this, value); + default Object read(String value) { + return TSerializer.read(this, value); } default String write() { diff --git a/src/main/scala/me/skymc/taboolib/common/serialize/TSerializerElement.java b/src/main/scala/me/skymc/taboolib/common/serialize/TSerializerElement.java index 3232eab..e660389 100644 --- a/src/main/scala/me/skymc/taboolib/common/serialize/TSerializerElement.java +++ b/src/main/scala/me/skymc/taboolib/common/serialize/TSerializerElement.java @@ -8,7 +8,7 @@ public interface TSerializerElement { T read(String value); - String write(Object value); + String write(T value); boolean matches(Class objectClass);