@Data
@AllArgsConstructor
@NoArgsConstructor
class Nation extends BaseSerializable {
@JSONField(defaultValue = "汉族", name= "name")
private String na_me;
@JSONField(ordinal = 1, name = "DRESS")
private String dress;
@JSONField(ordinal = 3, format = "yyyy-MM-dd")
private Date celebrateHoliday;
@JSONField(ordinal = 2, name = "number")
private Integer num;
}
Nation nationBean1 = Nation.builder().name("汉族").build();
String str = JSON.toJSONString(nationBean1);
System.out.println(str);