001 /* 002 * Copyright 2011 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.kfs.fp.businessobject; 017 018 import java.util.HashMap; 019 import java.util.LinkedHashMap; 020 import java.util.Map; 021 022 import org.kuali.kfs.sys.KFSPropertyConstants; 023 import org.kuali.kfs.sys.businessobject.Building; 024 import org.kuali.kfs.sys.businessobject.Room; 025 import org.kuali.kfs.sys.context.SpringContext; 026 import org.kuali.rice.kns.bo.Campus; 027 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 028 import org.kuali.rice.kns.service.KualiModuleService; 029 030 public class CapitalAssetInformationDetail extends PersistableBusinessObjectBase { 031 032 private String documentNumber; 033 private Integer itemLineNumber; 034 private String campusCode; 035 private String buildingCode; 036 private String buildingRoomNumber; 037 private String buildingSubRoomNumber; 038 private String capitalAssetTagNumber; 039 private String capitalAssetSerialNumber; 040 041 private Campus campus; 042 private Building building; 043 private Room room; 044 private CapitalAssetInformation capitalAssetInformation; 045 046 /** 047 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() 048 */ 049 protected LinkedHashMap toStringMapper() { 050 LinkedHashMap<String, Object> m = new LinkedHashMap<String, Object>(); 051 m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); 052 m.put(KFSPropertyConstants.ITEM_LINE_NUMBER, this.itemLineNumber); 053 return m; 054 } 055 056 /** 057 * Gets the documentNumber attribute. 058 * 059 * @return Returns the documentNumber. 060 */ 061 public String getDocumentNumber() { 062 return documentNumber; 063 } 064 065 /** 066 * Sets the documentNumber attribute value. 067 * 068 * @param documentNumber The documentNumber to set. 069 */ 070 public void setDocumentNumber(String documentNumber) { 071 this.documentNumber = documentNumber; 072 } 073 074 /** 075 * Gets the itemLineNumber attribute. 076 * 077 * @return Returns the itemLineNumber. 078 */ 079 public Integer getItemLineNumber() { 080 return itemLineNumber; 081 } 082 083 /** 084 * Sets the itemLineNumber attribute value. 085 * 086 * @param itemLineNumber The itemLineNumber to set. 087 */ 088 public void setItemLineNumber(Integer itemLineNumber) { 089 this.itemLineNumber = itemLineNumber; 090 } 091 092 /** 093 * Gets the campusCode attribute. 094 * 095 * @return Returns the campusCode. 096 */ 097 public String getCampusCode() { 098 return campusCode; 099 } 100 101 /** 102 * Sets the campusCode attribute value. 103 * 104 * @param campusCode The campusCode to set. 105 */ 106 public void setCampusCode(String campusCode) { 107 this.campusCode = campusCode; 108 } 109 110 /** 111 * Gets the buildingCode attribute. 112 * 113 * @return Returns the buildingCode. 114 */ 115 public String getBuildingCode() { 116 return buildingCode; 117 } 118 119 /** 120 * Sets the buildingCode attribute value. 121 * 122 * @param buildingCode The buildingCode to set. 123 */ 124 public void setBuildingCode(String buildingCode) { 125 this.buildingCode = buildingCode; 126 } 127 128 /** 129 * Gets the buildingRoomNumber attribute. 130 * 131 * @return Returns the buildingRoomNumber. 132 */ 133 public String getBuildingRoomNumber() { 134 return buildingRoomNumber; 135 } 136 137 /** 138 * Sets the buildingRoomNumber attribute value. 139 * 140 * @param buildingRoomNumber The buildingRoomNumber to set. 141 */ 142 public void setBuildingRoomNumber(String buildingRoomNumber) { 143 this.buildingRoomNumber = buildingRoomNumber; 144 } 145 146 /** 147 * Gets the capitalAssetTagNumber attribute. 148 * 149 * @return Returns the capitalAssetTagNumber. 150 */ 151 public String getCapitalAssetTagNumber() { 152 return capitalAssetTagNumber; 153 } 154 155 /** 156 * Sets the capitalAssetTagNumber attribute value. 157 * 158 * @param capitalAssetTagNumber The capitalAssetTagNumber to set. 159 */ 160 public void setCapitalAssetTagNumber(String capitalAssetTagNumber) { 161 this.capitalAssetTagNumber = capitalAssetTagNumber; 162 } 163 164 /** 165 * Gets the capitalAssetSerialNumber attribute. 166 * 167 * @return Returns the capitalAssetSerialNumber. 168 */ 169 public String getCapitalAssetSerialNumber() { 170 return capitalAssetSerialNumber; 171 } 172 173 /** 174 * Sets the capitalAssetSerialNumber attribute value. 175 * 176 * @param capitalAssetSerialNumber The capitalAssetSerialNumber to set. 177 */ 178 public void setCapitalAssetSerialNumber(String capitalAssetSerialNumber) { 179 this.capitalAssetSerialNumber = capitalAssetSerialNumber; 180 } 181 182 /** 183 * Gets the campus attribute. 184 * 185 * @return Returns the campus. 186 */ 187 public Campus getCampus() { 188 return campus = (Campus) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(Campus.class).retrieveExternalizableBusinessObjectIfNecessary(this, campus, "campus"); 189 } 190 191 /** 192 * Sets the campus attribute value. 193 * 194 * @param campus The campus to set. 195 */ 196 public void setCampus(Campus campus) { 197 this.campus = campus; 198 } 199 200 /** 201 * Gets the building attribute. 202 * 203 * @return Returns the building. 204 */ 205 public Building getBuilding() { 206 return building; 207 } 208 209 /** 210 * Sets the building attribute value. 211 * 212 * @param building The building to set. 213 */ 214 public void setBuilding(Building building) { 215 this.building = building; 216 } 217 218 /** 219 * Gets the room attribute. 220 * 221 * @return Returns the room. 222 */ 223 public Room getRoom() { 224 return room; 225 } 226 227 /** 228 * Sets the room attribute value. 229 * 230 * @param room The room to set. 231 */ 232 public void setRoom(Room room) { 233 this.room = room; 234 } 235 236 /** 237 * Gets the capitalAssetInformation attribute. 238 * 239 * @return Returns the capitalAssetInformation. 240 */ 241 public CapitalAssetInformation getCapitalAssetInformation() { 242 return capitalAssetInformation; 243 } 244 245 /** 246 * Sets the capitalAssetInformation attribute value. 247 * 248 * @param capitalAssetInformation The capitalAssetInformation to set. 249 */ 250 public void setCapitalAssetInformation(CapitalAssetInformation capitalAssetInformation) { 251 this.capitalAssetInformation = capitalAssetInformation; 252 } 253 254 /** 255 * Gets the buildingSubRoomNumber attribute. 256 * @return Returns the buildingSubRoomNumber. 257 */ 258 public String getBuildingSubRoomNumber() { 259 return buildingSubRoomNumber; 260 } 261 262 /** 263 * Sets the buildingSubRoomNumber attribute value. 264 * @param buildingSubRoomNumber The buildingSubRoomNumber to set. 265 */ 266 public void setBuildingSubRoomNumber(String buildingSubRoomNumber) { 267 this.buildingSubRoomNumber = buildingSubRoomNumber; 268 } 269 270 /** 271 * Returns a map with the primitive field names as the key and the primitive values as the map value. 272 * 273 * @return Map a map with the primitive field names as the key and the primitive values as the map value. 274 */ 275 public Map<String, Object> getValuesMap() { 276 Map<String, Object> simpleValues = new HashMap<String, Object>(); 277 278 simpleValues.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.getDocumentNumber()); 279 simpleValues.put(KFSPropertyConstants.CAMPUS_CODE, this.getCampusCode()); 280 simpleValues.put(KFSPropertyConstants.BUILDING_CODE, this.getBuildingCode()); 281 simpleValues.put(KFSPropertyConstants.BUILDING_ROOM_NUMBER, this.getBuildingRoomNumber()); 282 283 return simpleValues; 284 } 285 }