001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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:
017: package org.kuali.module.vendor.bo;
018:
019: import java.sql.Date;
020: import java.util.LinkedHashMap;
021: import java.util.List;
022:
023: import org.apache.commons.lang.builder.EqualsBuilder;
024: import org.apache.log4j.Logger;
025: import org.kuali.core.bo.PersistableBusinessObjectBase;
026: import org.kuali.core.util.TypedArrayList;
027:
028: /**
029: * Contains information specific to a parent Vendor, which may be shared by its division Vendors if it has any. Contained by a
030: * <code>VendorDetail</code>.
031: *
032: * @see org.kuali.module.vendor.bo.VendorDetail
033: */
034: public class VendorHeader extends PersistableBusinessObjectBase {
035: private static Logger LOG = Logger.getLogger(VendorHeader.class);
036:
037: private Integer vendorHeaderGeneratedIdentifier;
038: private String vendorTypeCode;
039: private String vendorTaxNumber;
040: private String vendorTaxTypeCode;
041: private String vendorOwnershipCode;
042: private String vendorOwnershipCategoryCode;
043: private Date vendorFederalWithholdingTaxBeginningDate;
044: private Date vendorFederalWithholdingTaxEndDate;
045: private Boolean vendorW9ReceivedIndicator;
046: private Boolean vendorW8BenReceivedIndicator;
047: private Boolean vendorDebarredIndicator;
048: private Boolean vendorForeignIndicator;
049:
050: private VendorType vendorType;
051: private OwnershipType vendorOwnership;
052: private OwnershipCategory vendorOwnershipCategory;
053: private List<VendorSupplierDiversity> vendorSupplierDiversities;
054: private List<VendorTaxChange> vendorTaxChanges;
055:
056: /**
057: * Default constructor.
058: */
059: public VendorHeader() {
060: vendorSupplierDiversities = new TypedArrayList(
061: VendorSupplierDiversity.class);
062: }
063:
064: public Integer getVendorHeaderGeneratedIdentifier() {
065:
066: return vendorHeaderGeneratedIdentifier;
067: }
068:
069: public void setVendorHeaderGeneratedIdentifier(
070: Integer vendorHeaderGeneratedIdentifier) {
071: this .vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
072: }
073:
074: public String getVendorTypeCode() {
075:
076: return vendorTypeCode;
077: }
078:
079: public void setVendorTypeCode(String vendorTypeCode) {
080: this .vendorTypeCode = vendorTypeCode;
081: }
082:
083: public String getVendorTaxNumber() {
084:
085: return vendorTaxNumber;
086: }
087:
088: public void setVendorTaxNumber(String vendorTaxNumber) {
089: this .vendorTaxNumber = vendorTaxNumber;
090: }
091:
092: public String getVendorTaxTypeCode() {
093:
094: return vendorTaxTypeCode;
095: }
096:
097: public void setVendorTaxTypeCode(String vendorTaxTypeCode) {
098: this .vendorTaxTypeCode = vendorTaxTypeCode;
099: }
100:
101: public String getVendorOwnershipCode() {
102:
103: return vendorOwnershipCode;
104: }
105:
106: public void setVendorOwnershipCode(String vendorOwnershipCode) {
107: this .vendorOwnershipCode = vendorOwnershipCode;
108: }
109:
110: public String getVendorOwnershipCategoryCode() {
111:
112: return vendorOwnershipCategoryCode;
113: }
114:
115: public void setVendorOwnershipCategoryCode(
116: String vendorOwnershipCategoryCode) {
117: this .vendorOwnershipCategoryCode = vendorOwnershipCategoryCode;
118: }
119:
120: public Date getVendorFederalWithholdingTaxBeginningDate() {
121:
122: return vendorFederalWithholdingTaxBeginningDate;
123: }
124:
125: public void setVendorFederalWithholdingTaxBeginningDate(
126: Date vendorFederalWithholdingTaxBeginningDate) {
127: this .vendorFederalWithholdingTaxBeginningDate = vendorFederalWithholdingTaxBeginningDate;
128: }
129:
130: public Date getVendorFederalWithholdingTaxEndDate() {
131:
132: return vendorFederalWithholdingTaxEndDate;
133: }
134:
135: public void setVendorFederalWithholdingTaxEndDate(
136: Date vendorFederalWithholdingTaxEndDate) {
137: this .vendorFederalWithholdingTaxEndDate = vendorFederalWithholdingTaxEndDate;
138: }
139:
140: public Boolean getVendorW9ReceivedIndicator() {
141:
142: return vendorW9ReceivedIndicator;
143: }
144:
145: public void setVendorW9ReceivedIndicator(
146: Boolean vendorW9ReceivedIndicator) {
147: this .vendorW9ReceivedIndicator = vendorW9ReceivedIndicator;
148: }
149:
150: public Boolean getVendorW8BenReceivedIndicator() {
151:
152: return vendorW8BenReceivedIndicator;
153: }
154:
155: public void setVendorW8BenReceivedIndicator(
156: Boolean vendorW8BenReceivedIndicator) {
157: this .vendorW8BenReceivedIndicator = vendorW8BenReceivedIndicator;
158: }
159:
160: public VendorType getVendorType() {
161:
162: return vendorType;
163: }
164:
165: /**
166: * Sets the vendorType attribute.
167: *
168: * @param vendorType The vendorType to set.
169: * @deprecated
170: */
171: public void setVendorType(VendorType vendorType) {
172: this .vendorType = vendorType;
173: }
174:
175: public OwnershipType getVendorOwnership() {
176:
177: return vendorOwnership;
178: }
179:
180: /**
181: * Sets the vendorOwnership attribute.
182: *
183: * @param vendorOwnership The vendorOwnership to set.
184: * @deprecated
185: */
186: public void setVendorOwnership(OwnershipType vendorOwnership) {
187: this .vendorOwnership = vendorOwnership;
188: }
189:
190: public OwnershipCategory getVendorOwnershipCategory() {
191:
192: return vendorOwnershipCategory;
193: }
194:
195: /**
196: * Sets the vendorOwnershipCategory attribute.
197: *
198: * @param vendorOwnershipCategory The vendorOwnershipCategory to set.
199: * @deprecated
200: */
201: public void setVendorOwnershipCategory(
202: OwnershipCategory vendorOwnershipCategory) {
203: this .vendorOwnershipCategory = vendorOwnershipCategory;
204: }
205:
206: public Boolean getVendorDebarredIndicator() {
207:
208: return vendorDebarredIndicator;
209: }
210:
211: /**
212: * Sets the vendorDebarredIndicator attribute value.
213: *
214: * @param vendorDebarredIndicator The vendorDebarredIndicator to set.
215: */
216: public void setVendorDebarredIndicator(
217: Boolean vendorDebarredIndicator) {
218: this .vendorDebarredIndicator = vendorDebarredIndicator;
219: }
220:
221: public Boolean getVendorForeignIndicator() {
222:
223: return vendorForeignIndicator;
224: }
225:
226: /**
227: * Sets the vendorForeignIndicator attribute value.
228: *
229: * @param vendorForeignIndicator The vendorForeignIndicator to set.
230: */
231: public void setVendorForeignIndicator(Boolean vendorForeignIndicator) {
232: this .vendorForeignIndicator = vendorForeignIndicator;
233: }
234:
235: public List<VendorSupplierDiversity> getVendorSupplierDiversities() {
236:
237: return vendorSupplierDiversities;
238: }
239:
240: public void setVendorSupplierDiversities(
241: List<VendorSupplierDiversity> vendorSupplierDiversities) {
242: this .vendorSupplierDiversities = vendorSupplierDiversities;
243: }
244:
245: public List<VendorTaxChange> getVendorTaxChanges() {
246:
247: return vendorTaxChanges;
248: }
249:
250: public void setVendorTaxChanges(
251: List<VendorTaxChange> vendorTaxChanges) {
252: this .vendorTaxChanges = vendorTaxChanges;
253: }
254:
255: /**
256: * This method is a predicate to test equality of all the persisted attributes of an instance of this class, including member
257: * collections. This is used to determine whether to route
258: *
259: * @param vh Another VendorHeader object
260: * @return True if all non-derived attributes of the given object are equal to this one's
261: */
262: public boolean isEqualForRouting(Object toCompare) {
263: LOG.debug("Entering isEqualForRouting.");
264: if (!(toCompare instanceof VendorHeader)) {
265: return false;
266: } else {
267: VendorHeader vh = (VendorHeader) toCompare;
268: return new EqualsBuilder()
269: .append(this .getVendorTypeCode(),
270: vh.getVendorTypeCode())
271: .append(this .getVendorTaxNumber(),
272: vh.getVendorTaxNumber())
273: .append(this .getVendorOwnershipCode(),
274: vh.getVendorOwnershipCode())
275: .append(this .getVendorOwnershipCategoryCode(),
276: vh.getVendorOwnershipCategoryCode())
277: .append(
278: this
279: .getVendorFederalWithholdingTaxBeginningDate(),
280: vh
281: .getVendorFederalWithholdingTaxBeginningDate())
282: .append(
283: this
284: .getVendorFederalWithholdingTaxEndDate(),
285: vh.getVendorFederalWithholdingTaxEndDate())
286: .append(this .getVendorW9ReceivedIndicator(),
287: vh.getVendorW9ReceivedIndicator()).append(
288: this .getVendorW8BenReceivedIndicator(),
289: vh.getVendorW8BenReceivedIndicator())
290: .append(this .getVendorDebarredIndicator(),
291: vh.getVendorDebarredIndicator()).append(
292: this .getVendorForeignIndicator(),
293: vh.getVendorForeignIndicator()).isEquals();
294: }
295: }
296:
297: /**
298: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
299: */
300: protected LinkedHashMap toStringMapper() {
301: LinkedHashMap m = new LinkedHashMap();
302: if (this .vendorHeaderGeneratedIdentifier != null) {
303: m.put("vendorHeaderGeneratedIdentifier",
304: this.vendorHeaderGeneratedIdentifier.toString());
305: }
306: return m;
307: }
308: }
|