1 package org.javabb.vo; 2 3 import java.io.Serializable ; 4 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 import org.apache.commons.lang.builder.HashCodeBuilder; 7 import org.apache.commons.lang.builder.ToStringBuilder; 8 9 24 25 29 public class Smile implements Serializable { 30 31 32 private Long _id; 33 34 private String _emoticon; 35 36 private String _symbol; 37 38 private String _filename; 39 40 46 public Smile(Long id, String emoticon, String symbol, String filename) { 47 this._id = id; 48 this._symbol = symbol; 49 this._emoticon = emoticon; 50 this._symbol = symbol; 51 this._filename = filename; 52 } 53 54 59 public Smile(String emoticon, String symbol, String filename) { 60 this(null, emoticon, symbol, filename); 61 } 62 63 66 public Smile() { 67 } 69 70 73 public Smile(Long id) { 74 setId(id); 75 } 76 77 80 public Long getId() { 81 return _id; 82 } 83 84 87 public void setId(Long id) { 88 this._id = id; 89 } 90 91 94 public String getEmoticon() { 95 return _emoticon; 96 } 97 98 101 public void setEmoticon(String emotion) { 102 this._emoticon = emotion; 103 } 104 105 108 public String getSymbol() { 109 return this._symbol; 110 } 111 112 115 public void setSymbol(String symbol) { 116 this._symbol = symbol; 117 } 118 119 122 public String getFilename() { 123 return _filename; 124 } 125 126 129 public void setFilename(String imageFile) { 130 this._filename = imageFile; 131 } 132 133 136 public String toString() { 137 return new ToStringBuilder(this).append(getId()) 138 .append(getSymbol()) 139 .append(getEmoticon()) 140 .append(getFilename()) 141 .toString(); 142 } 143 144 147 public boolean equals(Object o) { 148 if (!(o instanceof Smile)) { 149 return false; 150 } 151 Smile e = (Smile) o; 152 return new EqualsBuilder().append(this.getId(), e.getId()).isEquals(); 153 } 154 155 158 public int hashCode() { 159 return new HashCodeBuilder().append(getId()).toHashCode(); 160 } 161 } 162 | Popular Tags |