yujian
2020-05-06 a4637ae9d71aa4a624b217ed3a1483f0e3a3a7ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.yeshi.fanli.util.cache;
 
import java.util.ArrayList;
import java.util.List;
 
import com.google.gson.Gson;
 
import net.sf.json.JSONArray;
 
public class ObjectCacheUtil<T> {
 
//    public T getObj( String value) {
//        return new Gson().fromJson(value, Class<T>);
//    }
//
//    public List<T> getObjList(String value) {
//        List<T> list = new ArrayList<>();
//        JSONArray array = JSONArray.fromObject(value);
//        for (int i = 0; i < array.size(); i++) {
//            list.add(new Gson().fromJson(array.optJSONObject(i).toString(), T));
//        }
//        return list;
//    }
 
}