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        private String history;
042    
043        private Chart chartObj;
044        private Organization orgObj;
045        private Location locationObj;
046        
047        private List<TkRole> roles = new LinkedList<TkRole>();
048        private List<TkRole> inactiveRoles = new ArrayList<TkRole>();
049    
050        public String getDescription() {
051            return description;
052        }
053    
054        public void setDescription(String description) {
055            this.description = description;
056        }
057    
058        public String getChart() {
059            return chart;
060        }
061    
062        public void setChart(String chart) {
063            this.chart = chart;
064        }
065    
066        public String getOrg() {
067            return org;
068        }
069    
070        public void setOrg(String org) {
071            this.org = org;
072        }
073    
074            public String getHrDeptId() {
075                    return hrDeptId;
076            }
077    
078            public void setHrDeptId(String hrDeptId) {
079                    this.hrDeptId = hrDeptId;
080            }
081    
082            public String getDept() {
083                    return dept;
084            }
085    
086            public void setDept(String dept) {
087                    this.dept = dept;
088            }
089    
090            public Chart getChartObj() {
091                    return chartObj;
092            }
093    
094            public void setChartObj(Chart chartObj) {
095                    this.chartObj = chartObj;
096            }
097    
098            public Organization getOrgObj() {
099                    return orgObj;
100            }
101    
102            public void setOrgObj(Organization orgObj) {
103                    this.orgObj = orgObj;
104            }
105    
106            public List<TkRole> getRoles() {
107                    return roles;
108            }
109    
110            public void setRoles(List<TkRole> roles) {
111                    this.roles = roles;
112            }
113            
114            public List<TkRole> getInactiveRoles() {
115                    return inactiveRoles;
116            }
117    
118    
119            public void setInactiveRoles(List<TkRole> inactiveRoles) {
120                    this.inactiveRoles = inactiveRoles;
121            }
122    
123    
124            @Override
125            public String getUniqueKey() {
126                    return getDept() + "_" + getOrg() + "_" + getChart() + getRoles().size();
127            }
128    
129            @Override
130            public String getId() {
131                    return getHrDeptId();
132            }
133    
134            @Override
135            public void setId(String id) {
136                    setHrDeptId(id);
137            }
138    
139            public String getLocation() {
140                    return location;
141            }
142    
143            public void setLocation(String location) {
144                    this.location = location;
145            }
146    
147            public Location getLocationObj() {
148                    return locationObj;
149            }
150    
151            public void setLocationObj(Location locationObj) {
152                    this.locationObj = locationObj;
153            }
154            
155        public String getHistory() {
156            return history;
157        }
158    
159        public void setHistory(String history) {
160            this.history = history;
161        }
162    }