Android Handling JSON with Gson suggest change

Parsing JSON property to enum with Gson

If you want to parse a String to enum with Gson:

{“status” : “open”}
public enum Status {
    @SerializedName("open")
    OPEN,
    @SerializedName("waiting")
    WAITING,
    @SerializedName("confirm")
    CONFIRM,
    @SerializedName("ready")
    READY
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents