1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.businessobject;
17
18 import java.lang.reflect.InvocationTargetException;
19 import java.util.LinkedHashMap;
20
21 import org.apache.commons.beanutils.PropertyUtils;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.ole.sys.OLEPropertyConstants;
24 import org.kuali.rice.krad.bo.GlobalBusinessObjectDetailBase;
25
26
27
28
29 public class OrganizationReversionGlobalOrganization extends GlobalBusinessObjectDetailBase {
30 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OrganizationReversionGlobalOrganization.class);
31 private String documentNumber;
32 private String chartOfAccountsCode;
33 private String organizationCode;
34
35 private Chart chartOfAccounts;
36 private Organization organization;
37
38
39
40
41
42 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
43 LinkedHashMap stringMapper = new LinkedHashMap();
44 stringMapper.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
45 stringMapper.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.chartOfAccountsCode);
46 stringMapper.put(OLEPropertyConstants.ORGANIZATION_CODE, this.organizationCode);
47 return stringMapper;
48 }
49
50
51
52
53 public OrganizationReversionGlobalOrganization() {
54 super();
55 }
56
57
58
59
60
61
62 public String getDocumentNumber() {
63 return documentNumber;
64 }
65
66
67
68
69
70
71 public void setDocumentNumber(String documentNumber) {
72 this.documentNumber = documentNumber;
73 }
74
75
76
77
78
79
80 public Chart getChartOfAccounts() {
81 return chartOfAccounts;
82 }
83
84
85
86
87
88
89
90 public void setChartOfAccounts(Chart chartOfAccounts) {
91 this.chartOfAccounts = chartOfAccounts;
92 }
93
94
95
96
97
98
99 public String getChartOfAccountsCode() {
100 return chartOfAccountsCode;
101 }
102
103
104
105
106
107
108 public void setChartOfAccountsCode(String chartOfAccountsCode) {
109 this.chartOfAccountsCode = chartOfAccountsCode;
110 }
111
112
113
114
115
116
117 public Organization getOrganization() {
118 return organization;
119 }
120
121
122
123
124
125
126
127 public void setOrganization(Organization organization) {
128 this.organization = organization;
129 }
130
131
132
133
134
135
136 public String getOrganizationCode() {
137 return organizationCode;
138 }
139
140
141
142
143
144
145 public void setOrganizationCode(String organizationCode) {
146 this.organizationCode = organizationCode;
147 }
148
149
150
151
152
153
154
155 private String convertKeyToLockingRepresentation(String keyName) {
156 StringBuffer sb = new StringBuffer();
157 sb.append(keyName);
158 sb.append(OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
159 String keyValue = "";
160 try {
161 Object keyValueObj = PropertyUtils.getProperty(this, keyName);
162 if (keyValueObj != null) {
163 keyValue = keyValueObj.toString();
164 }
165 }
166 catch (IllegalAccessException iae) {
167 LOG.info("Illegal access exception while attempting to read property " + keyName, iae);
168 }
169 catch (InvocationTargetException ite) {
170 LOG.info("Illegal Target Exception while attempting to read property " + keyName, ite);
171 }
172 catch (NoSuchMethodException nsme) {
173 LOG.info("There is no such method to read property " + keyName + " in this class.", nsme);
174 }
175 finally {
176 sb.append(keyValue);
177 }
178 sb.append(OLEConstants.Maintenance.AFTER_VALUE_DELIM);
179 return sb.toString();
180 }
181
182
183
184
185 @Override
186 public int hashCode() {
187 final int PRIME = 31;
188 int result = 1;
189 result = PRIME * result + ((this.getChartOfAccountsCode() == null) ? 0 : this.getChartOfAccountsCode().hashCode());
190 result = PRIME * result + ((this.getDocumentNumber() == null) ? 0 : this.getDocumentNumber().hashCode());
191 result = PRIME * result + ((this.getOrganizationCode() == null) ? 0 : this.getOrganizationCode().hashCode());
192 return result;
193 }
194
195
196
197
198 @Override
199 public boolean equals(Object obj) {
200 if (this == obj)
201 return true;
202 if (obj == null)
203 return false;
204 if (getClass() != obj.getClass())
205 return false;
206 final OrganizationReversionGlobalOrganization other = (OrganizationReversionGlobalOrganization) obj;
207 if (this.getChartOfAccountsCode() == null) {
208 if (other.getChartOfAccountsCode() != null)
209 return false;
210 }
211 else if (!this.getChartOfAccountsCode().equals(other.getChartOfAccountsCode()))
212 return false;
213 if (this.getDocumentNumber() == null) {
214 if (other.getDocumentNumber() != null)
215 return false;
216 }
217 else if (!this.getDocumentNumber().equals(other.getDocumentNumber()))
218 return false;
219 if (this.getOrganizationCode() == null) {
220 if (other.getOrganizationCode() != null)
221 return false;
222 }
223 else if (!this.getOrganizationCode().equals(other.getOrganizationCode()))
224 return false;
225 return true;
226 }
227
228 }