package com.augurit.xmjg.approveInterface.bean; import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * 时间间隔配置 * @author zengxuechi */@Data public class DayDiffConfig implements Serializable { /** * 启用类型1还是类型2 */ private Integer type; /** * 类型1配置内容 */ private ConfigType1 configType1; /** * 类型2配置内容 */ private ConfigType2 configType2; @Data public static class ConfigType1 implements Serializable{ /** * 起始日期,是一个数字来的 */ private Integer startDay; /** * 时间区间,也就是间隔 */ private Integer diff; /** * 组数 */ private Integer rowNum; @Override public boolean equals(Object o) { if (this == o){ return true;} if (o == null || getClass() != o.getClass()){ return false;} ConfigType1 that = (ConfigType1) o; if(startDay==null){ if(that.startDay!=null){ return false; } }else{ if(!startDay.equals(that.startDay)){ return false; } } if(diff==null){ if(that.diff!=null){ return false; } }else{ if(!diff.equals(that.diff)){ return false; } } if(rowNum==null){ if(that.rowNum!=null){ return false; } }else{ if(!rowNum.equals(that.rowNum)){ return false; } } return true; } } @Data public static class ConfigType2 implements Serializable{ /** *开始日期 */ private Integer startDay; /** * 1-n组的时间间隔 */ private List<Integer> diffList = new ArrayList<>(); @Override public boolean equals(Object o) { if (this == o) {return true;} if (o == null || getClass() != o.getClass()){ return false;} ConfigType2 that = (ConfigType2) o; if(startDay==null){ if(that.startDay!=null){ return false; } }else{ if(!startDay.equals(that.startDay)){ return false; } } if(!diffList.equals(that.diffList)){ return false; } return true; } } @Override public boolean equals(Object o) { if (this == o){ return true;} if (o == null || getClass() != o.getClass()){ return false;} DayDiffConfig that = (DayDiffConfig) o; if(type==null){ if(that.getType()!=null){ return false; } }else{ if(!type.equals(that.type)){ return false; } } if(configType1==null){ if(that.configType1!=null){ return false; } }else{ if(!configType1.equals(that.configType1)){ return false; } } if(configType2==null){ if(that.configType2!=null){ return false; } }else { if(!configType2.equals(that.configType2)){ return false; } } return true; } }