@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getPermissionId() == null) ? 0 : getPermissionId().hashCode()); result = prime * result + ((getPermissionName() == null) ? 0 : getPermissionName().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getPermissionMenu() == null) ? 0 : getPermissionMenu().hashCode()); result = prime * result + ((getParentPermissionId() == null) ? 0 : getParentPermissionId().hashCode()); result = prime * result + ((getIsDir() == null) ? 0 : getIsDir().hashCode()); result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); return result; }
@Override public int compareTo(Permission o) { return this.getOrderNo().compareTo(o.getOrderNo()); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", permissionId=").append(permissionId); sb.append(", permissionName=").append(permissionName); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", permissionMenu=").append(permissionMenu); sb.append(", parentPermissionId=").append(parentPermissionId); sb.append(", isDir=").append(isDir); sb.append(", orderNo=").append(orderNo); sb.append("]"); return sb.toString(); }
@Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } Permission other = (Permission) that; return (this.getPermissionId() == null ? other.getPermissionId() == null : this.getPermissionId().equals(other.getPermissionId())) && (this.getPermissionName() == null ? other.getPermissionName() == null : this.getPermissionName().equals(other.getPermissionName())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getPermissionMenu() == null ? other.getPermissionMenu() == null : this.getPermissionMenu().equals(other.getPermissionMenu())) && (this.getParentPermissionId() == null ? other.getParentPermissionId() == null : this.getParentPermissionId().equals(other.getParentPermissionId())) && (this.getIsDir() == null ? other.getIsDir() == null : this.getIsDir().equals(other.getIsDir())) && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())); }