+ update TSerializer

This commit is contained in:
坏黑 2019-04-02 22:20:41 +08:00
parent 720ff96ac9
commit 4bf37340bc
2 changed files with 8 additions and 5 deletions

View File

@ -6,12 +6,15 @@ package me.skymc.taboolib.common.serialize;
*/ */
public interface TSerializable { 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) { default Object read(String value) {
TSerializer.read(this, value); return TSerializer.read(this, value);
} }
default String write() { default String write() {

View File

@ -8,7 +8,7 @@ public interface TSerializerElement<T> {
T read(String value); T read(String value);
String write(Object value); String write(T value);
boolean matches(Class objectClass); boolean matches(Class objectClass);