gson

http://www.cnblogs.com/jiayongji/p/5297187.html (gson converts the returned string data into entity classes)  
  
Example 1 of Json conversion tool Gson - simple object conversion and List conversion with generics  
http://blog.csdn.net/lk_blog/article/details/7685169   
   
package cardvalue.managementsystem.pojo;  
import com.google.gson.Gson;  
/**
 * Created by Administrator on 2017/7/7.
 */  
public class Result<T> {  
    public String type;  
    public String result;  
    public int code;  
  
    public String getType() {  
        return type;  
    }  
  
    public void setType(String type) {  
        this.type = type;  
    }  
  
    public String getResult() {  
        return result;  
    }  
  
    public void setResult(String result) {  
        this.result = result;  
    }  
  
    public int getCode() {  
        return code;  
    }  
  
    public void setCode(int code) {  
        this.code = code;  
    }  
  
    public T parseJsonWithGson(String result, Class type) {  
        Gson gson = new Gson ();  
        T result1 = (T)gson.fromJson(result, type);  
        return result1;  
    }  
  
}  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325839359&siteId=291194637