-
Notifications
You must be signed in to change notification settings - Fork 8
/
Entity.java
70 lines (56 loc) · 1.4 KB
/
Entity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package sk.dejavu.blog.examples.paramconverters.model;
/**
* @author Michal Gajdos
*/
public class Entity {
private String foo;
private String bar;
public Entity() {
}
public Entity(final String foo, final String bar) {
this.foo = foo;
this.bar = bar;
}
public String getFoo() {
return foo;
}
public void setFoo(final String foo) {
this.foo = foo;
}
public String getBar() {
return bar;
}
public void setBar(final String bar) {
this.bar = bar;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Entity entity = (Entity) o;
if (bar != null ? !bar.equals(entity.bar) : entity.bar != null) {
return false;
}
if (foo != null ? !foo.equals(entity.foo) : entity.foo != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = foo != null ? foo.hashCode() : 0;
result = 31 * result + (bar != null ? bar.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Entity{" +
"foo='" + foo + '\'' +
", bar='" + bar + '\'' +
'}';
}
}