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

com.envisioniot.enos.enosapi.common.util.JsonParser Maven / Gradle / Ivy

There is a newer version: 2.1.5
Show newest version
/**
 * Project: eeop
 * 

* Copyright http://www.envisioncn.com/ All rights reserved. * * @author xiaomin.zhou */ package com.envisioniot.enos.enosapi.common.util; import com.google.gson.Gson; import java.lang.reflect.Type; /** * Json Parser */ public class JsonParser { private static final Gson gson = new Gson(); //Dummy Constructor private JsonParser() { } //Json To Object By Gson public static T fromJson(String json, Class classOfT) { return gson.fromJson(json, classOfT); } //Json To Object By Gson public static T fromJson(String json, Type typeOfT) { return gson.fromJson(json, typeOfT); } //Object To Json By Gson public static String toJson(Object object) { return gson.toJson(object); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy