1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kfs.coa.businessobject;
17
18 import java.util.LinkedHashMap;
19
20 import org.apache.commons.lang.StringUtils;
21 import org.apache.log4j.Logger;
22 import org.kuali.rice.core.api.mo.common.active.Inactivatable;
23 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24
25
26
27
28 public class Organization extends PersistableBusinessObjectBase implements Inactivatable {
29 private static final Logger LOG = Logger.getLogger(Organization.class);
30
31 private static final long serialVersionUID = 121873645110037203L;
32
33
34
35
36
37 private String organizationCode;
38 private String organizationName;
39 private Chart chartOfAccounts;
40 private boolean active;
41
42
43 private String chartOfAccountsCode;
44
45
46
47
48
49
50 public String getOrganizationCode() {
51 return organizationCode;
52 }
53
54
55
56
57
58
59 public void setOrganizationCode(String organizationCode) {
60 this.organizationCode = organizationCode;
61 }
62
63
64
65
66
67
68 public String getOrganizationName() {
69 return organizationName;
70 }
71
72
73
74
75
76
77 public void setOrganizationName(String organizationName) {
78 this.organizationName = organizationName;
79 }
80
81
82
83
84
85
86
87
88 public Chart getChartOfAccounts() {
89 return chartOfAccounts;
90 }
91
92
93
94
95
96
97
98 public void setChartOfAccounts(Chart chartOfAccounts) {
99 this.chartOfAccounts = chartOfAccounts;
100 }
101
102
103
104
105
106
107 public String getChartOfAccountsCode() {
108 return chartOfAccountsCode;
109 }
110
111
112
113
114
115
116 public void setChartOfAccountsCode(String chartOfAccountsCode) {
117 this.chartOfAccountsCode = chartOfAccountsCode;
118 }
119
120
121
122
123
124 protected LinkedHashMap toStringMapper() {
125 LinkedHashMap m = new LinkedHashMap();
126
127 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
128 m.put("organizationCode", this.organizationCode);
129
130 return m;
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157 public boolean equals(Object obj) {
158 boolean equal = false;
159
160 LOG.debug("Org equals");
161
162 if (obj != null) {
163
164 if (this == obj)
165 return true;
166
167 if (this.getClass().isAssignableFrom(obj.getClass())) {
168
169 Organization other = (Organization) obj;
170
171 LOG.debug("this: " + this);
172 LOG.debug("other: " + other);
173
174 if (StringUtils.equals(this.getChartOfAccountsCode(), other.getChartOfAccountsCode())) {
175 if (StringUtils.equals(this.getOrganizationCode(), other.getOrganizationCode())) {
176 equal = true;
177 }
178 }
179 }
180 }
181
182 return equal;
183 }
184
185
186
187
188 public String getCodeAndDescription() {
189 String theString = getOrganizationCode() + "-" + getOrganizationName();
190 return theString;
191 }
192
193
194
195
196 public int hashCode() {
197 String hashString = getChartOfAccountsCode() + "|" + getOrganizationCode();
198 return hashString.hashCode();
199 }
200
201 public boolean isActive() {
202 return active;
203 }
204
205 public void setActive(boolean active) {
206 this.active = active;
207 }
208
209 }