/
Cat.java
66 lines (52 loc) · 1.19 KB
/
Cat.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
package org.springframework.obm.messagepack;
/**
* dummy entity to test
*
* @author Josh Long
*/
public class Cat {
private String name;
private int id;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Cat(String name, int id) {
this.name = name;
this.id = id;
}
public Cat() {
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Cat that = (Cat) o;
return id == that.id && !(name != null ? !name.equals(that.name) : that.name != null);
}
@Override
public String toString() {
return "Cat{" +
"name='" + name + '\'' +
", id=" + id +
'}';
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + id;
return result;
}
}