01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.sampleu.travel.bo;
17:
18: import java.util.LinkedHashMap;
19: import java.util.List;
20:
21: import org.apache.commons.lang.ObjectUtils;
22: import org.apache.commons.lang.StringUtils;
23: import org.kuali.core.bo.PersistableBusinessObjectBase;
24:
25: /**
26: * FiscalOfficer
27: */
28: public class FiscalOfficer extends PersistableBusinessObjectBase {
29:
30: private String userName;
31: private Long id;
32: private List<TravelAccount> accounts;
33:
34: public void setUserName(String userId) {
35: userName = userId;
36: }
37:
38: public String getUserName() {
39: return userName;
40: }
41:
42: public final boolean equals(Object o) {
43: if (o == null)
44: return false;
45: if (!(o instanceof FiscalOfficer))
46: return false;
47: FiscalOfficer f = (FiscalOfficer) o;
48: return StringUtils.equals(userName, f.getUserName())
49: && ObjectUtils.equals(id, f.getId());
50: }
51:
52: /**
53: * Returns the hashcode of the docHeaderId, which is supposed to be the
54: * primary key for the document
55: *
56: * @see java.lang.Object#hashCode()
57: */
58: /*public int hashCode() {
59: return (accountNum == null) ? 0 : accountNum.hashCode();
60: }*/
61:
62: public Long getId() {
63: return id;
64: }
65:
66: public void setId(Long id) {
67: this .id = id;
68: }
69:
70: public List<TravelAccount> getAccounts() {
71: return accounts;
72: }
73:
74: public void setAccounts(List<TravelAccount> accounts) {
75: this .accounts = accounts;
76: }
77:
78: /*
79: public String toString() {
80: return "(" + userName + "," + accountNum + ")";
81: }*/
82: public String toString() {
83: return "[FiscalOfficer: id=" + id + ", userName=" + userName
84: + "]";
85: }
86:
87: @Override
88: protected LinkedHashMap toStringMapper() {
89: LinkedHashMap propMap = new LinkedHashMap();
90: propMap.put("id", getId());
91: propMap.put("userName", getUserName());
92: return propMap;
93: }
94:
95: }
|