package com.dspread.pos.data.local;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * Helper class for JSON serialization/deserialization
 */
public class GsonHelper {
    private static final Gson gson = new GsonBuilder().create();

    public static <T> String toJson(T object) {
        return gson.toJson(object);
    }

    public static <T> T fromJson(String json, Class<T> classOfT) {
        return gson.fromJson(json, classOfT);
    }
}