KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > vo > Smile


1 package org.javabb.vo;
2
3 import java.io.Serializable JavaDoc;
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 /*
10  * Copyright 2004 JavaFree.org
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24
25 /**
26  * $Id: Smile.java,v 1.4.8.2 2006/04/17 17:46:53 daltoncamargo Exp $
27  * @author Ronald Tetsuo Miura
28  */

29 public class Smile implements Serializable JavaDoc {
30
31     /** */
32     private Long JavaDoc _id;
33     /** */
34     private String JavaDoc _emoticon;
35     /** */
36     private String JavaDoc _symbol;
37     /** */
38     private String JavaDoc _filename;
39
40     /**
41      * @param id
42      * @param emoticon
43      * @param symbol
44      * @param filename
45      */

46     public Smile(Long JavaDoc id, String JavaDoc emoticon, String JavaDoc symbol, String JavaDoc filename) {
47         this._id = id;
48         this._symbol = symbol;
49         this._emoticon = emoticon;
50         this._symbol = symbol;
51         this._filename = filename;
52     }
53
54     /**
55      * @param emoticon
56      * @param symbol
57      * @param filename
58      */

59     public Smile(String JavaDoc emoticon, String JavaDoc symbol, String JavaDoc filename) {
60         this(null, emoticon, symbol, filename);
61     }
62
63     /**
64      * Default constructor.
65      */

66     public Smile() {
67         // do nothing
68
}
69
70     /**
71      * @param id
72      */

73     public Smile(Long JavaDoc id) {
74         setId(id);
75     }
76
77     /**
78      * @return id
79      */

80     public Long JavaDoc getId() {
81         return _id;
82     }
83
84     /**
85      * @param id
86      */

87     public void setId(Long JavaDoc id) {
88         this._id = id;
89     }
90
91     /**
92      * @return emotion
93      */

94     public String JavaDoc getEmoticon() {
95         return _emoticon;
96     }
97
98     /**
99      * @param emotion
100      */

101     public void setEmoticon(String JavaDoc emotion) {
102         this._emoticon = emotion;
103     }
104
105     /**
106      * @return textual symbol of the emoticon
107      */

108     public String JavaDoc getSymbol() {
109         return this._symbol;
110     }
111
112     /**
113      * @param symbol
114      */

115     public void setSymbol(String JavaDoc symbol) {
116         this._symbol = symbol;
117     }
118
119     /**
120      * @return the image filename
121      */

122     public String JavaDoc getFilename() {
123         return _filename;
124     }
125
126     /**
127      * @param imageFile the new image filename.
128      */

129     public void setFilename(String JavaDoc imageFile) {
130         this._filename = imageFile;
131     }
132
133     /**
134      * @see java.lang.Object#toString()
135      */

136     public String JavaDoc toString() {
137         return new ToStringBuilder(this).append(getId())
138             .append(getSymbol())
139             .append(getEmoticon())
140             .append(getFilename())
141             .toString();
142     }
143
144     /**
145      * @see java.lang.Object#equals(java.lang.Object)
146      */

147     public boolean equals(Object JavaDoc 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     /**
156      * @see java.lang.Object#hashCode()
157      */

158     public int hashCode() {
159         return new HashCodeBuilder().append(getId()).toHashCode();
160     }
161 }
162
Popular Tags