View Javadoc

1   /*
2    * Joey and its relative products are published under the terms
3    * of the Apache Software License.
4    */
5   /*
6    * Created on 2004/01/27
7    */
8   package org.asyrinx.joey.gen.model;
9   
10  import org.apache.commons.lang.builder.EqualsBuilder;
11  
12  /***
13   * @author akima
14   */
15  public class EnumerationEntry extends Element {
16  
17      /***
18       *  
19       */
20      public EnumerationEntry() {
21          super();
22      }
23  
24      /***
25       *  
26       */
27      public EnumerationEntry(AbstractEnumeration parent, String name, String label) {
28          this(parent, null, name, label);
29      }
30  
31      /***
32       *  
33       */
34      public EnumerationEntry(AbstractEnumeration parent, String value, String name, String label) {
35          super(parent, name, label);
36          this.value = value;
37      }
38  
39      /*
40       * (non-Javadoc)
41       * 
42       * @see org.asyrinx.joey.gen.model.Element#getParentElement()
43       */
44      public AbstractEnumeration getParent() {
45          return (AbstractEnumeration) super.getParentElement();
46      }
47  
48      private String value = null;
49  
50      /***
51       * @return Returns the value.
52       */
53      public String getValue() {
54          return value;
55      }
56  
57      /***
58       * @param value
59       *            The value to set.
60       */
61      public void setValue(String value) {
62          this.value = value;
63      }
64  
65      /*
66       * (non-Javadoc)
67       * 
68       * @see java.lang.Object#equals(java.lang.Object)
69       */
70      public boolean equals(Object obj) {
71          if (!super.equals(obj))
72              return false;
73          if (!(obj instanceof EnumerationEntry))
74              return false;
75          final EnumerationEntry other = (EnumerationEntry) obj;
76          return new EqualsBuilder() //
77                  .append(this.getValue(), other.getValue()) //
78                  .isEquals();
79      }
80  
81  }