1 package org.apache.commons.ognl.enhance;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class LocalReferenceImpl
26 implements LocalReference
27 {
28
29 private final String name;
30
31 private final Class<?> type;
32
33 private final String expression;
34
35 public LocalReferenceImpl( String name, String expression, Class<?> type )
36 {
37 this.name = name;
38 this.type = type;
39 this.expression = expression;
40 }
41
42
43
44
45 public String getName()
46 {
47 return name;
48 }
49
50
51
52
53 public String getExpression()
54 {
55 return expression;
56 }
57
58
59
60
61 public Class<?> getType()
62 {
63 return type;
64 }
65
66
67
68
69 @Override
70 public boolean equals( Object o )
71 {
72 if ( this == o )
73 {
74 return true;
75 }
76 if ( o == null || getClass() != o.getClass() )
77 {
78 return false;
79 }
80
81 LocalReferenceImpl that = (LocalReferenceImpl) o;
82
83 if ( expression != null ? !expression.equals( that.expression ) : that.expression != null )
84 {
85 return false;
86 }
87 if ( name != null ? !name.equals( that.name ) : that.name != null )
88 {
89 return false;
90 }
91 if ( type != null ? !type.equals( that.type ) : that.type != null )
92 {
93 return false;
94 }
95
96 return true;
97 }
98
99
100
101
102 @Override
103 public int hashCode()
104 {
105 int result;
106 result = ( name != null ? name.hashCode() : 0 );
107 result = 31 * result + ( type != null ? type.hashCode() : 0 );
108 result = 31 * result + ( expression != null ? expression.hashCode() : 0 );
109 return result;
110 }
111
112
113
114
115 @Override
116 public String toString()
117 {
118 return "LocalReferenceImpl[" + "_name='" + name + '\'' + '\n' + ", _type=" + type + '\n' + ", _expression='"
119 + expression + '\'' + '\n' + ']';
120 }
121 }