Romik romikromik Romik romikromik - 6 months ago 18
Java Question

jackson. if string named like numerical value

Have some json

"car": {
"0": "bentley cont",
"1": "2.5",
"2": "2015"
}


What i have to do for work with it. How correctly realize this.

enter image description here

Answer Source

You can do this if you are using Jackson:

   @JsonProperty("0")
    private String _0;
    @JsonProperty("1")
    private String _1;
    @JsonProperty("2")
    private String _2;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download