View Javadoc

1   package org.gnomekr.potron.data;
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   /***
10   * PluralForms.java
11   * @author Xavier Cho
12   * @version $Revision 1.1 $ $Date: 2005/07/24 02:29:15 $
13   */
14  public class PluralForms implements Serializable {
15  
16      private static final long serialVersionUID = 3936850793373924438L;
17  
18      private int count;
19      private String expression;
20  
21      public PluralForms() {
22      }
23  
24      /***
25       * @param count
26       * @param expression
27       */
28      public PluralForms(int count, String expression) {
29          this.count = count;
30          this.expression = expression;
31      }
32  
33      /***
34       * @return Returns the name.
35       * @hibernate.property
36       *          column = "plural_cnt"
37       *          length = "10"
38       *          update = "true"
39       *          not-null = "false"
40       */
41      public int getCount() {
42          return count;
43      }
44  
45      /***
46       * @param count The count to set.
47       */
48      public void setCount(int count) {
49          this.count = count;
50      }
51  
52      /***
53       * @return Returns the expression.
54       * @hibernate.property
55       *          column = "plural_exp"
56       *          length = "400"
57       *          update = "true"
58       *          not-null = "false"
59       */
60      public String getExpression() {
61          return expression;
62      }
63  
64      /***
65       * @param value The expression to set.
66       */
67      public void setExpression(String expression) {
68          this.expression = expression;
69      }
70  
71      /***
72       * @see java.lang.Object#equals(java.lang.Object)
73       */
74      public boolean equals(final Object object) {
75          if (object instanceof PluralForms) {
76              PluralForms forms = (PluralForms) object;
77  
78              EqualsBuilder builder = new EqualsBuilder();
79              builder.append(count, forms.getCount());
80              builder.append(expression, forms.getExpression());
81  
82              return builder.isEquals();
83          }
84  
85          return false;
86      }
87  
88      /***
89       * @see java.lang.Object#toString()
90       */
91      public String toString() {
92          ToStringBuilder builder = new ToStringBuilder(this);
93          builder.append("count", count);
94          builder.append("expression", expression);
95  
96          return builder.toString();
97      }
98  
99      /***
100      * @see java.lang.Object#hashCode()
101      */
102     public int hashCode() {
103         HashCodeBuilder builder = new HashCodeBuilder();
104         builder.append(count);
105         builder.append(expression);
106         return builder.toHashCode();
107     }
108 }