Gson gson = new Gson(); // Or use new GsonBuilder().create(); MyType target2 = gson.fromJson(json, MyType.class); // deserializes json into target2