Newer
Older
package it.inaf.ia2.gms.persistence.model;
import it.inaf.ia2.gms.model.Permission;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
public class PermissionEntity {
private String userId;
private String groupId;
private Permission permission;
// The group path is copied here for performance reasons
private String groupPath;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public Permission getPermission() {
return permission;
}
public void setPermission(Permission permission) {
this.permission = permission;
}
public String getGroupPath() {
return groupPath;
}
public void setGroupPath(String groupPath) {
this.groupPath = groupPath;
}
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@Override
public int hashCode() {
int hash = 5;
hash = 41 * hash + Objects.hashCode(this.userId);
hash = 41 * hash + Objects.hashCode(this.groupId);
hash = 41 * hash + Objects.hashCode(this.permission);
hash = 41 * hash + Objects.hashCode(this.groupPath);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PermissionEntity other = (PermissionEntity) obj;
if (!Objects.equals(this.userId, other.userId)) {
return false;
}
if (!Objects.equals(this.groupId, other.groupId)) {
return false;
}
if (!Objects.equals(this.groupPath, other.groupPath)) {
return false;
}
return this.permission == other.permission;
}