View Javadoc

1   /*
2    * SetValueImpl.java
3    * Created on 26 Июнь 2006 г., 15:45
4    */
5   
6   package org.weda.property.impl;
7   
8   import org.weda.enhance.InjectInplaceMessage;
9   import org.weda.property.Constraint;
10  import org.weda.property.SetValue;
11  
12  /**
13   *
14   * @author Mikhail Titov
15   */
16  public class SetValueImpl implements SetValue {
17      private Object value;
18      private Constraint constraint;
19      
20      @InjectInplaceMessage private String alias;
21      
22      public SetValueImpl(){
23      }
24      
25      public SetValueImpl(Object value) {
26          this.value = value;
27      }
28      
29      public SetValueImpl(Object value, String alias) {
30          this(value);
31          this.alias = alias;
32      }
33  
34      public Object getValue() {
35          return value;
36      }
37      
38      public void setValue(Object value){
39          this.value = value;
40      }
41      
42      public String getAlias() {
43          return alias;
44      }
45      
46      public void setAlias(String alias){
47          this.alias = alias;
48      }
49      
50      public boolean equals(Object obj){
51          if (obj instanceof SetValueImpl){
52              SetValueImpl o = (SetValueImpl)obj;
53              return value.equals(o.getValue());
54          }else
55              return false;
56      }
57      
58      public int hashCode() {
59          return value.hashCode();
60      }
61  
62      public Constraint getConstraint() {
63          return constraint;
64      }
65  
66      public void setConstraint(Constraint constraint) {
67          this.constraint = constraint;
68      }
69      
70  }