1 package de.dlr.shepard.neo4Core.entities;
2
3 import org.neo4j.ogm.annotation.Relationship;
4
5 import de.dlr.shepard.util.Constants;
6 import de.dlr.shepard.util.HasId;
7 import lombok.Data;
8 import lombok.NoArgsConstructor;
9 import lombok.ToString;
10
11 @Data
12 @ToString(callSuper = true)
13 @NoArgsConstructor
14 public class BasicContainer extends BasicEntity {
15
16 @ToString.Exclude
17 @Relationship(type = Constants.HAS_PERMISSIONS)
18 private Permissions permissions;
19
20
21
22
23
24
25 public BasicContainer(long id) {
26 super(id);
27 }
28
29 @Override
30 public int hashCode() {
31 final int prime = 31;
32 int result = super.hashCode();
33 result = prime * result + HasId.hashcodeHelper(permissions);
34 return result;
35 }
36
37 @Override
38 public boolean equals(Object obj) {
39 if (this == obj)
40 return true;
41 if (!super.equals(obj))
42 return false;
43 if (!(obj instanceof BasicContainer))
44 return false;
45 BasicContainer other = (BasicContainer) obj;
46 return HasId.equalsHelper(permissions, other.permissions);
47 }
48
49 }