1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.businessobject;
17
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.ole.integration.purap.CapitalAssetLocation;
21 import org.kuali.ole.integration.purap.CapitalAssetSystem;
22 import org.kuali.ole.integration.purap.ItemCapitalAsset;
23 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24
25 import java.util.ArrayList;
26 import java.util.LinkedHashMap;
27 import java.util.List;
28
29 public abstract class PurchasingCapitalAssetSystemBase extends PersistableBusinessObjectBase implements CapitalAssetSystem {
30
31 private Integer capitalAssetSystemIdentifier;
32 private String capitalAssetSystemDescription;
33 private boolean capitalAssetNotReceivedCurrentFiscalYearIndicator;
34 private String capitalAssetTypeCode;
35 private String capitalAssetManufacturerName;
36 private String capitalAssetModelDescription;
37 private String capitalAssetNoteText;
38 private List<ItemCapitalAsset> itemCapitalAssets;
39 private List<CapitalAssetLocation> capitalAssetLocations;
40 private CapitalAssetLocation newPurchasingCapitalAssetLocationLine;
41 private Integer capitalAssetCountAssetNumber;
42
43 public Integer getCapitalAssetCountAssetNumber() {
44 return capitalAssetCountAssetNumber;
45 }
46
47 public void setCapitalAssetCountAssetNumber(Integer capitalAssetCountAssetNumber) {
48 this.capitalAssetCountAssetNumber = capitalAssetCountAssetNumber;
49 }
50
51 public PurchasingCapitalAssetSystemBase() {
52 super();
53 itemCapitalAssets = new ArrayList();
54 capitalAssetLocations = new ArrayList();
55 this.setNewPurchasingCapitalAssetLocationLine(this.setupNewPurchasingCapitalAssetLocationLine());
56 }
57
58 public String getCapitalAssetSystemDescription() {
59
60 if (StringUtils.isEmpty(capitalAssetSystemDescription)) {
61 capitalAssetSystemDescription = new String(" ");
62 }
63 return capitalAssetSystemDescription;
64 }
65
66 public void setCapitalAssetSystemDescription(String capitalAssetSystemDescription) {
67 this.capitalAssetSystemDescription = capitalAssetSystemDescription;
68 }
69
70 public boolean isCapitalAssetNotReceivedCurrentFiscalYearIndicator() {
71 return capitalAssetNotReceivedCurrentFiscalYearIndicator;
72 }
73
74 public void setCapitalAssetNotReceivedCurrentFiscalYearIndicator(boolean capitalAssetNotReceivedCurrentFiscalYearIndicator) {
75 this.capitalAssetNotReceivedCurrentFiscalYearIndicator = capitalAssetNotReceivedCurrentFiscalYearIndicator;
76 }
77
78 public String getCapitalAssetTypeCode() {
79 return capitalAssetTypeCode;
80 }
81
82 public void setCapitalAssetTypeCode(String capitalAssetTypeCode) {
83 this.capitalAssetTypeCode = capitalAssetTypeCode;
84 }
85
86 public String getCapitalAssetManufacturerName() {
87 return capitalAssetManufacturerName;
88 }
89
90 public void setCapitalAssetManufacturerName(String capitalAssetManufacturerName) {
91 this.capitalAssetManufacturerName = capitalAssetManufacturerName;
92 }
93
94 public String getCapitalAssetModelDescription() {
95 return capitalAssetModelDescription;
96 }
97
98 public void setCapitalAssetModelDescription(String capitalAssetModelDescription) {
99 this.capitalAssetModelDescription = capitalAssetModelDescription;
100 }
101
102 public List<ItemCapitalAsset> getItemCapitalAssets() {
103 return itemCapitalAssets;
104 }
105
106 public void setItemCapitalAssets(List<ItemCapitalAsset> itemCapitalAssets) {
107 this.itemCapitalAssets = itemCapitalAssets;
108 }
109
110 public List<CapitalAssetLocation> getCapitalAssetLocations() {
111 return capitalAssetLocations;
112 }
113
114 public void setCapitalAssetLocations(List<CapitalAssetLocation> capitalAssetLocations) {
115 this.capitalAssetLocations = capitalAssetLocations;
116 }
117
118 public Integer getCapitalAssetSystemIdentifier() {
119 return capitalAssetSystemIdentifier;
120 }
121
122 public void setCapitalAssetSystemIdentifier(Integer capitalAssetSystemIdentifier) {
123 this.capitalAssetSystemIdentifier = capitalAssetSystemIdentifier;
124 }
125
126 public String getCapitalAssetNoteText() {
127
128 if (StringUtils.isEmpty(capitalAssetNoteText)) {
129 capitalAssetNoteText = new String(" ");
130 }
131 return capitalAssetNoteText;
132 }
133
134 public void setCapitalAssetNoteText(String capitalAssetNoteText) {
135 this.capitalAssetNoteText = capitalAssetNoteText;
136 }
137
138 public boolean isEmpty() {
139 return !(StringUtils.isNotEmpty(capitalAssetNoteText) || StringUtils.isNotEmpty(capitalAssetSystemDescription) || StringUtils.isNotEmpty(capitalAssetManufacturerName) || StringUtils.isNotEmpty(this.capitalAssetModelDescription) || StringUtils.isNotEmpty(capitalAssetTypeCode));
140 }
141
142 public abstract Class getItemCapitalAssetClass();
143
144 public abstract Class getCapitalAssetLocationClass();
145
146
147 public CapitalAssetLocation setupNewPurchasingCapitalAssetLocationLine() {
148 CapitalAssetLocation location = null;
149 try {
150 location = (CapitalAssetLocation) getCapitalAssetLocationClass().newInstance();
151 } catch (InstantiationException e) {
152 throw new RuntimeException("Unable to get class");
153 } catch (IllegalAccessException e) {
154 throw new RuntimeException("Unable to get class");
155 } catch (NullPointerException e) {
156 throw new RuntimeException("Can't instantiate Purchasing Account from base");
157 }
158
159 return location;
160 }
161
162 public void setNewPurchasingCapitalAssetLocationLine(CapitalAssetLocation newCapitalAssetLocationLine) {
163 this.newPurchasingCapitalAssetLocationLine = newCapitalAssetLocationLine;
164 }
165
166 public CapitalAssetLocation getNewPurchasingCapitalAssetLocationLine() {
167 return newPurchasingCapitalAssetLocationLine;
168 }
169
170 public CapitalAssetLocation getAndResetNewPurchasingCapitalAssetLocationLine() {
171 CapitalAssetLocation asset = getNewPurchasingCapitalAssetLocationLine();
172 setNewPurchasingCapitalAssetLocationLine(setupNewPurchasingCapitalAssetLocationLine());
173 return asset;
174 }
175
176 public void resetNewPurchasingCapitalAssetLocationLine() {
177 setNewPurchasingCapitalAssetLocationLine(setupNewPurchasingCapitalAssetLocationLine());
178 }
179
180 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
181 LinkedHashMap m = new LinkedHashMap();
182 if (this.capitalAssetSystemIdentifier != null) {
183 m.put("capitalAssetSystemIdentifier", this.capitalAssetSystemIdentifier.toString());
184 }
185 return m;
186 }
187
188 }