I have an object gson.JsonObject. What is the easiest way to create an object from it org.json.JSONObject?
gson.JsonObject
org.json.JSONObject
Thanks in advance.
get the JSON string again JsonObjectand parse it intoJsonObject
JsonObject
JsonObject gson = new JsonParser().parse("{\"id\":\"value\"}").getAsJsonObject(); JSONObject jo2 = new JSONObject(gson.toString());
new org.json.JSONObject(gson.toJson(gson.JsonObject));
Source: https://habr.com/ru/post/1017263/More articles:When changing the resolution, the application crashes in the background - quickly - iosHow to get context of current request in spring -webflux - spring-webfluxMaterial-UI next - styling text inside ListItemText - reactjshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1017261/real-js-classes-in-scalajs-to-develop-webcomponents&usg=ALkJrhitlhTGHH9ErjXpeclh4lHSQtWCNQHeroku запускает изображение Docker с параметром порта - dockerScala JS extending HTMLElement to create custom element - javascriptI want to create a simple general method for counting numbers after applying a filter - javaValueError: cannot pass input array from form (224,224,3) to form (224,224) - pythonCrashlytics says log download is complete but nothing is in the toolbar - androidWhat could it be? [TsLint Error: "Promises should be handled accordingly"] - javascriptAll Articles