@Test public void convertWithExternalUseGson() throws Exception { Gson gson = AospGsonBuilder.build(); String converted = gson.toJson(new SomeEntity()); JSONObject obj = new JSONObject(converted); Assert.assertEquals(1, obj.getInt("id")); Assert.assertEquals("hoge", obj.getString("hoge")); Assert.assertEquals("foo", obj.getString("type")); Assert.assertEquals("Android", obj.getString("name")); Assert.assertFalse(obj.has("should_excluded")); Assert.assertFalse(obj.has("constant")); Assert.assertFalse(obj.has("CONSTANT")); }
public static Gson build() { return buildUpon().create(); }
AospGsonBuilder { public static Gson build() { return buildUpon().create(); } }
AospGsonBuilder { public static Gson build() { return buildUpon().create(); } private  AospGsonBuilder(); }
AospGsonBuilder { public static Gson build() { return buildUpon().create(); } private  AospGsonBuilder(); static Gson build(); static GsonBuilder buildUpon(); }
AospGsonBuilder { public static Gson build() { return buildUpon().create(); } private  AospGsonBuilder(); static Gson build(); static GsonBuilder buildUpon();  }