com.cherokeesoft.db.utils.serialise.JoinField Maven / Gradle / Ivy
package com.cherokeesoft.db.utils.serialise;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.Getter;
import lombok.Setter;
public class JoinField {
private @Getter @Setter String json;
private Gson gson = new GsonBuilder().create();
public T getValue(Class tClass) {
if(json != null) {
return gson.fromJson(json, tClass);
}
return null;
}
public void setValue(T value) {
if(value != null) {
json = gson.toJson(value);
}
}
}