/
Belt.java
70 lines (54 loc) · 1.43 KB
/
Belt.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 be.celludriel.universegenerator.model;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class Belt extends AbstractJson {
private BeltType type;
private Long x;
private Long y;
private Integer rotation;
public BeltType getType() {
return type;
}
public Long getX() {
return x;
}
public Long getY() {
return y;
}
public Integer getRotation() {
return rotation;
}
public void setType(BeltType type) {
this.type = type;
}
public void setX(Long x) {
this.x = x;
}
public void setY(Long y) {
this.y = y;
}
public void setRotation(Integer rotation) {
this.rotation = rotation;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Belt belt = (Belt) o;
return new EqualsBuilder()
.append(x, belt.x)
.append(y, belt.y)
.append(rotation, belt.rotation)
.append(type, belt.type)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(type)
.append(x)
.append(y)
.append(rotation)
.toHashCode();
}
}