JamesDeCarlo / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Add support of @SerializedName to enums #347

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Usually, by naming conventions, enum members have all letters in uppercase. If 
the serialized object has the field of the enum type, then it gets serialized 
as an uppercase string. Gson ignores the annotation  @SerializedName on the 
enum.

See example:

{{{
public enum Status {
  @SerializedName("placed")
  PLACED,

  @SerializedName("settled")
  SETTLED,

  @SerializedName("disputed")
  DISPUTED,

  @SerializedName("refunded")
  REFUNDED,

  @SerializedName("canceled")
  CANCELED;
}

}}}

Original issue reported on code.google.com by illarion.kovalchuk on 14 Jul 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Issue 363 has been merged into this issue.

Original comment by limpbizkit on 16 Dec 2011 at 5:23

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1078.

Original comment by limpbizkit on 16 Dec 2011 at 5:32

GoogleCodeExporter commented 9 years ago
Fixed. Apologies for the delay!

Original comment by limpbizkit on 16 Dec 2011 at 5:33

GoogleCodeExporter commented 9 years ago
sads

Original comment by Sezgin8...@gmail.com on 31 Jan 2014 at 3:07