View Javadoc

1   /*
2    * Copyright 2007-2008 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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 org.kuali.rice.kns.test.document.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.rice.kns.bo.PersistableBusinessObjectBase;
24  
25  
26  /**
27   * FiscalOfficer
28   */
29  public class AccountManager extends PersistableBusinessObjectBase {
30  	
31  	private String userName;
32  	private Long amId;
33  	private String defaultType;
34  	private List<Account> accounts;
35  
36  	public void setUserName(String userId) {
37  		userName = userId;
38  	}
39  
40  	public String getUserName() {
41  		return userName;
42  	}
43  
44  	public String getDefaultType() {
45          return this.defaultType;
46      }
47  
48      public void setDefaultType(String defaultType) {
49          this.defaultType = defaultType;
50      }
51  
52      public final boolean equals(Object o) {
53          if (o == null) return false;
54          if (!(o instanceof AccountManager)) return false;
55          AccountManager am = (AccountManager) o;
56          return StringUtils.equals(userName, am.getUserName()) &&
57                 ObjectUtils.equals(amId, am.getAmId());
58  	}
59  
60  	/**
61  	 * Returns the hashcode of the docHeaderId, which is supposed to be the
62  	 * primary key for the document
63  	 * 
64  	 * @see java.lang.Object#hashCode()
65  	 */
66  	/*public int hashCode() {
67  		return (accountNum == null) ? 0 : accountNum.hashCode();
68  	}*/
69  
70  	public Long getAmId() {
71  		return amId;
72  	}
73  
74  	public void setAmId(Long id) {
75  		this.amId = id;
76  	}
77  
78      public List<Account> getAccounts() {
79          return accounts;
80      }
81  
82      public void setAccounts(List<Account> accounts) {
83          this.accounts = accounts;
84      }
85  
86      /*
87      public String toString() {
88          return "(" + userName + "," + accountNum + ")";
89      }*/
90      public String toString() {
91          return "[FiscalOfficer: id=" + amId +
92                               ", userName=" + userName +
93                               "]";
94      }
95      
96      @Override
97      protected LinkedHashMap toStringMapper() {
98          LinkedHashMap propMap = new LinkedHashMap();
99          propMap.put("id", getAmId());
100         propMap.put("userName", getUserName());
101         return propMap;
102     }
103     
104 }