How to annotate enum fields for deserialization using Jackson json

前端 未结 6 1066
一个人的身影
一个人的身影 2020-12-02 19:59

I am using REST web service/Apache Wink with Jackson 1.6.2. How do I annotate an enum field so that Jackson deserializes it?

Inner class

public enum          


        
6条回答
  •  醉话见心
    2020-12-02 20:41

    With Jackson 2.7.2 or newer

    public enum BooleanField
    {
        @JsonProperty("1")
        BOOLEAN_TRUE,
        @JsonProperty("0")
        BOOLEAN_FALSE
    }
    

提交回复
热议问题