001 /**
002 * Copyright 2004-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.hr.time.department;
017
018 import java.util.ArrayList;
019 import java.util.LinkedList;
020 import java.util.List;
021
022 import org.kuali.hr.core.KPMEConstants;
023 import org.kuali.hr.location.Location;
024 import org.kuali.hr.time.HrBusinessObject;
025 import org.kuali.hr.time.roles.TkRole;
026 import org.kuali.kfs.coa.businessobject.Chart;
027 import org.kuali.kfs.coa.businessobject.Organization;
028
029 public class Department extends HrBusinessObject {
030
031 private static final long serialVersionUID = -7856741688212725536L;
032
033 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Department";
034
035 private String hrDeptId;
036 private String dept;
037 private String description;
038 private String chart;
039 private String org;
040 private String location;
041
042 private Chart chartObj;
043 private Organization orgObj;
044 private Location locationObj;
045
046 private List<TkRole> roles = new LinkedList<TkRole>();
047 private List<TkRole> inactiveRoles = new ArrayList<TkRole>();
048
049 public String getDescription() {
050 return description;
051 }
052
053 public void setDescription(String description) {
054 this.description = description;
055 }
056
057 public String getChart() {
058 return chart;
059 }
060
061 public void setChart(String chart) {
062 this.chart = chart;
063 }
064
065 public String getOrg() {
066 return org;
067 }
068
069 public void setOrg(String org) {
070 this.org = org;
071 }
072
073 public String getHrDeptId() {
074 return hrDeptId;
075 }
076
077 public void setHrDeptId(String hrDeptId) {
078 this.hrDeptId = hrDeptId;
079 }
080
081 public String getDept() {
082 return dept;
083 }
084
085 public void setDept(String dept) {
086 this.dept = dept;
087 }
088
089 public Chart getChartObj() {
090 return chartObj;
091 }
092
093 public void setChartObj(Chart chartObj) {
094 this.chartObj = chartObj;
095 }
096
097 public Organization getOrgObj() {
098 return orgObj;
099 }
100
101 public void setOrgObj(Organization orgObj) {
102 this.orgObj = orgObj;
103 }
104
105 public List<TkRole> getRoles() {
106 return roles;
107 }
108
109 public void setRoles(List<TkRole> roles) {
110 this.roles = roles;
111 }
112
113 public List<TkRole> getInactiveRoles() {
114 return inactiveRoles;
115 }
116
117
118 public void setInactiveRoles(List<TkRole> inactiveRoles) {
119 this.inactiveRoles = inactiveRoles;
120 }
121
122
123 @Override
124 public String getUniqueKey() {
125 return getDept() + "_" + getOrg() + "_" + getChart() + getRoles().size();
126 }
127
128 @Override
129 public String getId() {
130 return getHrDeptId();
131 }
132
133 @Override
134 public void setId(String id) {
135 setHrDeptId(id);
136 }
137
138 public String getLocation() {
139 return location;
140 }
141
142 public void setLocation(String location) {
143 this.location = location;
144 }
145
146 public Location getLocationObj() {
147 return locationObj;
148 }
149
150 public void setLocationObj(Location locationObj) {
151 this.locationObj = locationObj;
152 }
153 }