封装请求类,里面有其他类例子

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;

    }


}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值