/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/ChestBean.java
ViewVC logotype

Annotation of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/ChestBean.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1904 - (hide annotations) (download)
Tue Dec 18 10:33:47 2012 UTC (11 years, 5 months ago) by torben
File size: 2294 byte(s)
store a cached modifyUsers as set<String> since it will be called quite often
1 torben 1805 package dk.thoerup.bukkit.hoeruputils.chests;
2    
3    
4     import javax.persistence.Entity;
5     import javax.persistence.GeneratedValue;
6     import javax.persistence.Id;
7 torben 1904 import javax.persistence.Transient;
8 torben 1805
9 torben 1904 import java.util.Set;
10 torben 1805
11 torben 1904 import dk.thoerup.bukkit.hoeruputils.Util;
12 torben 1805
13 torben 1904
14 torben 1805 @Entity
15 torben 1807 public class ChestBean {
16     final static int LOCKED = 1;
17     final static int SNITCHING = 2;
18    
19    
20 torben 1805 @Id
21     @GeneratedValue
22     int id;
23    
24     String owner;
25     String description;
26    
27     String world;
28     int x;
29     int y;
30     int z;
31    
32     boolean doublechest = false;
33    
34 torben 1807 String modifyPlayers;
35    
36     int chestType;
37 torben 1805
38 torben 1869 String comment = "";
39 torben 1805
40 torben 1904 @Transient
41     Set<String> modifyPlayersSet;
42 torben 1805
43 torben 1807 public int getChestType() {
44     return chestType;
45     }
46     public void setChestType(int chestType) {
47     this.chestType = chestType;
48     }
49 torben 1805 public String getOwner() {
50     return owner;
51     }
52     public void setOwner(String owner) {
53     this.owner = owner;
54     }
55     public String getDescription() {
56     return description;
57     }
58     public void setDescription(String description) {
59     this.description = description;
60     }
61    
62     public int getId() {
63     return id;
64     }
65    
66     public void setId(int id) {
67     this.id = id;
68     }
69    
70     public String getWorld() {
71     return world;
72     }
73    
74     public void setWorld(String world) {
75     this.world = world;
76     }
77    
78     public int getX() {
79     return x;
80     }
81    
82     public void setX(int x) {
83     this.x = x;
84     }
85    
86     public int getY() {
87     return y;
88     }
89    
90     public void setY(int y) {
91     this.y = y;
92     }
93    
94     public int getZ() {
95     return z;
96     }
97    
98     public void setZ(int z) {
99     this.z = z;
100     }
101     public boolean isDoublechest() {
102     return doublechest;
103     }
104     public void setDoublechest(boolean doublechest) {
105     this.doublechest = doublechest;
106     }
107    
108     public String getModifyPlayers() {
109     return modifyPlayers;
110     }
111     public void setModifyPlayers(String modifyPlayers) {
112     this.modifyPlayers = modifyPlayers;
113 torben 1904
114     this.modifyPlayersSet = Util.stringToSet( modifyPlayers );
115 torben 1805 }
116 torben 1869
117 torben 1904 public Set<String> getModifyPlayersSet() {
118     return modifyPlayersSet;
119     }
120    
121     /*public void setModifyPlayersSet(Set<String> modifyPlayersSet) {
122     this.modifyPlayersSet = modifyPlayersSet;
123     }*/
124    
125 torben 1869 public String getComment() {
126     return comment;
127     }
128     public void setComment(String comment) {
129 torben 1871 this.comment = comment.trim();
130 torben 1869 }
131 torben 1871
132     public String getCommentString() {
133     if (this.comment == null || this.comment.length() == 0)
134     return "";
135    
136     return " (Comment: " + this.comment + ")";
137     }
138 torben 1805
139     }

  ViewVC Help
Powered by ViewVC 1.1.20