1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.commons.ognl.test.objects;
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25 public class Bean3
26 {
27 private int value = 100;
28
29 private Map map;
30 {
31 map = new HashMap();
32 map.put( "foo", "bar" );
33 map.put( "bar", "baz" );
34 }
35
36 private String _nullValue;
37
38 private Object _indexValue;
39
40 public int getValue()
41 {
42 return value;
43 }
44
45 public void setValue( int value )
46 {
47 this.value = value;
48 }
49
50 public Object getIndexedValue( int index )
51 {
52 return _indexValue;
53 }
54
55 public void setIndexedValue( int index, Object value )
56 {
57 _indexValue = value;
58 }
59
60 public Map getMap()
61 {
62 return map;
63 }
64
65 public void setNullValue( String value )
66 {
67 _nullValue = value;
68 }
69
70 public String getNullValue()
71 {
72 return _nullValue;
73 }
74
75
76
77
78
79 public int hashCode()
80 {
81 final int prime = 31;
82 int result = 1;
83 result = prime * result + ( ( _indexValue == null ) ? 0 : _indexValue.hashCode() );
84 return result;
85 }
86
87
88
89
90
91 public boolean equals( Object obj )
92 {
93 if ( this == obj )
94 return true;
95 if ( obj == null )
96 return false;
97 if ( getClass() != obj.getClass() )
98 return false;
99 final Bean3 other = (Bean3) obj;
100 if ( _indexValue == null )
101 {
102 if ( other._indexValue != null )
103 return false;
104 }
105 else if ( !_indexValue.equals( other._indexValue ) )
106 return false;
107 return true;
108 }
109 }