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