--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/ChestBean.java 2012/11/06 16:49:06 1869 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/ChestBean.java 2012/12/18 10:33:47 1904 @@ -4,7 +4,11 @@ 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 @@ -33,7 +37,8 @@ String comment = ""; - + @Transient + Set modifyPlayersSet; public int getChestType() { return chestType; @@ -105,13 +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; + this.comment = comment.trim(); + } + + public String getCommentString() { + if (this.comment == null || this.comment.length() == 0) + return ""; + + return " (Comment: " + this.comment + ")"; } }