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

前端 未结 4 1543
北恋
北恋 2020-12-10 04:31

I\'m currently writing an RSS feed parser in Java utilizing Gson. I\'m converting the RSS\' XML into JSON, and then subsequently using Gson to deserialize the JSON into Java

4条回答
  •  余生分开走
    2020-12-10 05:11

    Make it as Object Class instead of Other Class Type and Type cast according to the call

    // RSSFeedItem.java
    private Object guid;
    

提交回复
热议问题