Creating Java Object with reserved keywords as variable name

后端 未结 3 1443
小蘑菇
小蘑菇 2020-12-12 00:08

I have JSON that needs to be converted to a Java Object. The JSONs I need to handle can look like this:

{
    \"documents\": [
        {
        \"title\": \         


        
3条回答
  •  佛祖请我去吃肉
    2020-12-12 00:19

    If you use GSON for parsing you can name your members as you want and annotate them for mapping.

    @SerializedName("abstract")
    private String abstractText;
    

提交回复
热议问题