本文共 847 字,大约阅读时间需要 2 分钟。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | public class User { private int id; @JsonProperty ( "isMale" ) private boolean isMale; private String name; public User() { } public User( int id, boolean isMale, String name) { this .id = id; this .isMale = isMale; this .name = name; } public int getId() { return id; } public void setId( int id) { this .id = id; } @JsonIgnore public boolean isMale() { return isMale; } public void setMale( boolean isMale) { this .isMale = isMale; } public String getName() { return name; } public void setName(String name) { this .name = name; } } |
转载地址:http://cdvja.baihongyu.com/