All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.houbbbbb.sso.util.GsonUtil Maven / Gradle / Ivy

package com.github.houbbbbb.sso.util;

import com.google.gson.Gson;

/**
 * @author : hbw
 * @desctiption :
 * @date : 2020-05-22 18:39
 */
public class GsonUtil {
    private static final Gson gson = new Gson();
    public static String toJson(Object o){
        return gson.toJson(o);
    }
    public static  T toObj(String json, Class clazz){
        if(null!=json) {
            return gson.fromJson(json, clazz);
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy