序列化及反序列化指定字段名
序列化及反序列化指定字段名
核心注解@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;
}
原创:做时间的朋友