--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/LockedChestBean.java 2012/05/28 15:36:28 1805 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/ChestBean.java 2012/12/18 10:33:47 1904 @@ -4,11 +4,19 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Transient; +import java.util.Set; + +import dk.thoerup.bukkit.hoeruputils.Util; @Entity -public class LockedChestBean { +public class ChestBean { + final static int LOCKED = 1; + final static int SNITCHING = 2; + + @Id @GeneratedValue int id; @@ -23,11 +31,21 @@ boolean doublechest = false; - String modifyPlayers; - + String modifyPlayers; + int chestType; + String comment = ""; + + @Transient + Set modifyPlayersSet; + public int getChestType() { + return chestType; + } + public void setChestType(int chestType) { + this.chestType = chestType; + } public String getOwner() { return owner; } @@ -92,6 +110,30 @@ } public void setModifyPlayers(String modifyPlayers) { this.modifyPlayers = modifyPlayers; + + this.modifyPlayersSet = Util.stringToSet( modifyPlayers ); + } + + public Set getModifyPlayersSet() { + return modifyPlayersSet; + } + + /*public void setModifyPlayersSet(Set modifyPlayersSet) { + this.modifyPlayersSet = modifyPlayersSet; + }*/ + + public String getComment() { + return comment; + } + public void setComment(String comment) { + this.comment = comment.trim(); + } + + public String getCommentString() { + if (this.comment == null || this.comment.length() == 0) + return ""; + + return " (Comment: " + this.comment + ")"; } }