/
EntityLimitsDO.java
91 lines (75 loc) · 2 KB
/
EntityLimitsDO.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package bentobox.addon.limits.objects;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import com.google.gson.annotations.Expose;
import world.bentobox.bentobox.database.objects.DataObject;
/**
* @author tastybento
*
*/
public class EntityLimitsDO implements DataObject {
@Expose
private String uniqueId = "";
@Expose
private Map<UUID, String> spawnLoc = new HashMap<>();
public EntityLimitsDO() {}
public EntityLimitsDO(String uniqueId) {
this.uniqueId = uniqueId;
}
/* (non-Javadoc)
* @see world.bentobox.bentobox.database.objects.DataObject#getUniqueId()
*/
@Override
public String getUniqueId() {
return uniqueId;
}
/* (non-Javadoc)
* @see world.bentobox.bentobox.database.objects.DataObject#setUniqueId(java.lang.String)
*/
@Override
public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}
/**
* @return the spawnLoc
*/
public Map<UUID, String> getSpawnLoc() {
return spawnLoc;
}
/**
* @param spawnLoc the spawnLoc to set
*/
public void setSpawnLoc(Map<UUID, String> spawnLoc) {
this.spawnLoc = spawnLoc;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EntityLimitsDO)) {
return false;
}
EntityLimitsDO other = (EntityLimitsDO) obj;
if (uniqueId == null) {
return other.uniqueId == null;
} else return uniqueId.equals(other.uniqueId);
}
}