zoukankan      html  css  js  c++  java
  • 重写equals、hashCode、toString方法

    public boolean equals(Object o) {
            if (o == this) {
                return true;
            } else if (!(o instanceof LearningTaskDto)) {
                return false;
            } else {
                LearningTaskDto other = (LearningTaskDto)o;
                if (!other.canEqual(this)) {
                    return false;
                } else {
                    Object this$assignUsers = this.getAssignUsers();
                    Object other$assignUsers = other.getAssignUsers();
                    if (this$assignUsers == null) {
                        if (other$assignUsers != null) {
                            return false;
                        }
                    } else if (!this$assignUsers.equals(other$assignUsers)) {
                        return false;
                    }
    
                    Object this$courseIds = this.getCourseIds();
                    Object other$courseIds = other.getCourseIds();
                    if (this$courseIds == null) {
                        if (other$courseIds != null) {
                            return false;
                        }
                    } else if (!this$courseIds.equals(other$courseIds)) {
                        return false;
                    }
    
                    return true;
                }
            }
        }
     
    public int hashCode() {
            int PRIME = true;
            int result = 1;
            Object $assignUsers = this.getAssignUsers();
            int result = result * 59 + ($assignUsers == null ? 43 : $assignUsers.hashCode());
            Object $courseIds = this.getCourseIds();
            result = result * 59 + ($courseIds == null ? 43 : $courseIds.hashCode());
            return result;
        }
    
        public String toString() {
            return "LearningTaskDto(assignUsers=" + this.getAssignUsers() + ", courseIds=" + this.getCourseIds() + ")";
        }
    随笔看心情
  • 相关阅读:
    PAT 乙级 1012 数字分类 (20) C++版
    PAT 乙级 1026 程序运行时间(15) C++版
    PAT 乙级 1009 说反话 (20) C++版
    PAT 乙级 1042 字符统计(20) C++版
    PAT 乙级 1046 划拳(15) C++版
    PAT 乙级 1063 计算谱半径(20) C++版
    CentOS安装oracle12C
    linux端口详解
    yum提示字符编码错误
    securecrt中文乱码
  • 原文地址:https://www.cnblogs.com/stromgao/p/15160651.html
Copyright © 2011-2022 走看看