cl.transbank.onepay.util.OnepayJsonUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transbank-sdk-java Show documentation
Show all versions of transbank-sdk-java Show documentation
Tranbank API integration SDK for Java Projects
package cl.transbank.onepay.util;
import com.google.gson.Gson;
public final class OnepayJsonUtil implements JsonUtil {
private static volatile OnepayJsonUtil instance;
private Gson gson;
private OnepayJsonUtil() {
super();
gson = new Gson();
}
public String jsonEncode(Object o) {
return gson.toJson(o);
}
public T jsonDecode(String json, Class clazz) {
return gson.fromJson(json, clazz);
}
public static OnepayJsonUtil getInstance() {
if (null == instance) {
synchronized (OnepayJsonUtil.class) {
instance = new OnepayJsonUtil();
}
}
return instance;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy