序列化及反序列化指定字段名

序列化及反序列化指定字段名

核心注解@SerializedName(value = "")

import com.google.gson.annotations.SerializedName;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class RuntimeRule {
	@SerializedName(value = "src_metric")
	private String srcMetric;
	private String expression;
	private String threshold;
	private String level;
	@SerializedName(value = "resgroup_code")
	private String resGroupCode;
}
posted @ 2023-10-25 15:44  SpecialSpeculator  阅读(71)  评论(0编辑  收藏  举报