|
@@ -22,6 +22,28 @@ public class User {
|
22
|
22
|
this.name = name;
|
23
|
23
|
}
|
24
|
24
|
|
|
25
|
+ @Override
|
|
26
|
+ public boolean equals(Object object){
|
|
27
|
+ if (this == object) {
|
|
28
|
+ return true;
|
|
29
|
+ }
|
|
30
|
+ if (object == null) {
|
|
31
|
+ return false;
|
|
32
|
+ }
|
|
33
|
+ if(getClass() != object.getClass()) {
|
|
34
|
+ return false;
|
|
35
|
+ }
|
|
36
|
+ User user = (User) object;
|
|
37
|
+ return Objects.equals(name, user.getName())
|
|
38
|
+ && Objects.equals(id, user.getId());
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ @Override
|
|
42
|
+ public int hashCode() {
|
|
43
|
+ return Objects.hash(name, id);
|
|
44
|
+ }
|
|
45
|
+
|
|
46
|
+
|
25
|
47
|
public long getId() {
|
26
|
48
|
return id;
|
27
|
49
|
}
|