【问题标题】:Json with different types in fieds to java object字段中具有不同类型的 Json 到 java 对象
【发布时间】:2018-03-15 11:55:40
【问题描述】:

我尝试使用Gson 将此json 转换为java 对象。如何转换字段“内容”? 有时是字符串,有时是具有两个字段的对象。

"content": "TODO List",

"content": {
      "one": "one",
       "other": "other"
}

【问题讨论】:

    标签: java json object gson pojo


    【解决方案1】:

    回答以下问题,可能有助于解决您的问题。

    How to handle different data types with same attribute name with Gson?

    【讨论】:

      猜你喜欢
      • 2017-11-09
      • 1970-01-01
      • 2018-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-13
      相关资源
      最近更新 更多