栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

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

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

package com.augurit.xmjg.approveInterface.bean;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


@Data
public class DayDiffConfig implements Serializable {
    
    private Integer type;
    
    private ConfigType1 configType1;
    
    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;
        
        private List 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;

    }


}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/532321.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号