Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package greensyntax.in.co.fragmentviewsample;
- import com.google.gson.Gson;
- public class JSONParser {
- private static Gson gson = new Gson();
- // Parse Obj => JSON String
- public <T extends Object> String inJSON(T obj) {
- return gson.toJson(obj);
- }
- public <T extends Object, E extends Class<T>> T inObjects(String jsonString, E className) {
- return gson.fromJson(jsonString, className);
- }
- }
Add Comment
Please, Sign In to add comment