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