エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Gson: Directly convert String to JsonObject (no POJO)
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Gson: Directly convert String to JsonObject (no POJO)
Can't seem to figure this out. I'm attempting JSON tree manipulation in GSON, but I have a case w... Can't seem to figure this out. I'm attempting JSON tree manipulation in GSON, but I have a case where I do not know or have a POJO to convert a string into, prior to converting to JsonObject. Is there a way to go directly from a String to JsonObject? I've tried the following (Scala syntax): val gson = (new GsonBuilder).create val a: JsonObject = gson.toJsonTree("""{ "a": "A", "b": true }""").getAs