ml.shifu.guagua.yarn.util
类 GsonUtils

java.lang.Object
  继承者 ml.shifu.guagua.yarn.util.GsonUtils

public final class GsonUtils
extends Object

GsonUtils is used for Object-JSON JSON-Object conversion.

To reduce new operations, only one Gson instance in this class.


方法摘要
static
<T> T
fromJson(String json, Class<T> c)
          De-serialize JSON-format string to an object.
static String toJson(Object src)
          Serialize an object to JSON-format string.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

toJson

public static String toJson(Object src)
Serialize an object to JSON-format string.


fromJson

public static <T> T fromJson(String json,
                             Class<T> c)
De-serialize JSON-format string to an object.



Copyright © 2014. All Rights Reserved.