Gson: @Expose vs @SerializedName

后端 未结 4 1737
无人及你
无人及你 2020-12-08 02:00

With respect to Gson what is the difference between @Expose and @SerializedName(\"stringValue\")?

4条回答
  •  盖世英雄少女心
    2020-12-08 02:24

    @SerializeName is used to set the key that json object will include ,however @Expose is used to decide whether the variable will be exposed for Serialisation and Deserialisation ,or not. Here's the documentation of @Expose.

提交回复
热议问题