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.util.LinkedHashMap;
020:
021: import org.apache.commons.lang.builder.EqualsBuilder;
022: import org.kuali.core.bo.Inactivateable;
023: import org.kuali.core.bo.PersistableBusinessObjectBase;
024: import org.kuali.core.util.ObjectUtils;
025: import org.kuali.module.vendor.util.VendorRoutingComparable;
026:
027: /**
028: * Relationship between a Vendor and a <code>ShippingSpecialCondition</code>.
029: *
030: * @see org.kuali.module.vendor.bo.ShippingSpecialCondition
031: */
032: public class VendorShippingSpecialCondition extends
033: PersistableBusinessObjectBase implements
034: VendorRoutingComparable, Inactivateable {
035:
036: private Integer vendorHeaderGeneratedIdentifier;
037: private Integer vendorDetailAssignedIdentifier;
038: private String vendorShippingSpecialConditionCode;
039: private boolean active;
040:
041: private VendorDetail vendorDetail;
042: private ShippingSpecialCondition vendorShippingSpecialCondition;
043:
044: /**
045: * Default constructor.
046: */
047: public VendorShippingSpecialCondition() {
048:
049: }
050:
051: public Integer getVendorHeaderGeneratedIdentifier() {
052:
053: return vendorHeaderGeneratedIdentifier;
054: }
055:
056: public void setVendorHeaderGeneratedIdentifier(
057: Integer vendorHeaderGeneratedIdentifier) {
058: this .vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
059: }
060:
061: public Integer getVendorDetailAssignedIdentifier() {
062:
063: return vendorDetailAssignedIdentifier;
064: }
065:
066: public void setVendorDetailAssignedIdentifier(
067: Integer vendorDetailAssignedIdentifier) {
068: this .vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
069: }
070:
071: public String getVendorShippingSpecialConditionCode() {
072:
073: return vendorShippingSpecialConditionCode;
074: }
075:
076: public void setVendorShippingSpecialConditionCode(
077: String vendorShippingSpecialConditionCode) {
078: this .vendorShippingSpecialConditionCode = vendorShippingSpecialConditionCode;
079: }
080:
081: public boolean isActive() {
082:
083: return active;
084: }
085:
086: public void setActive(boolean active) {
087: this .active = active;
088: }
089:
090: public VendorDetail getVendorDetail() {
091:
092: return vendorDetail;
093: }
094:
095: /**
096: * Sets the vendorDetail attribute value.
097: *
098: * @param vendorDetail The vendorDetail to set.
099: * @deprecated
100: */
101: public void setVendorDetail(VendorDetail vendorDetail) {
102: this .vendorDetail = vendorDetail;
103: }
104:
105: public ShippingSpecialCondition getVendorShippingSpecialCondition() {
106:
107: return vendorShippingSpecialCondition;
108: }
109:
110: /**
111: * Sets the vendorShippingSpecialCondition attribute value.
112: *
113: * @param vendorShippingSpecialCondition The vendorShippingSpecialCondition to set.
114: * @deprecated
115: */
116: public void setVendorShippingSpecialCondition(
117: ShippingSpecialCondition vendorShippingSpecialCondition) {
118: this .vendorShippingSpecialCondition = vendorShippingSpecialCondition;
119: }
120:
121: /**
122: * @see org.kuali.module.vendor.util.VendorRoutingComparable#isEqualForRouting(java.lang.Object)
123: */
124: public boolean isEqualForRouting(Object toCompare) {
125: if ((ObjectUtils.isNull(toCompare))
126: || !(toCompare instanceof VendorShippingSpecialCondition)) {
127: return false;
128: } else {
129: VendorShippingSpecialCondition vssc = (VendorShippingSpecialCondition) toCompare;
130:
131: return new EqualsBuilder().append(
132: this .getVendorHeaderGeneratedIdentifier(),
133: vssc.getVendorHeaderGeneratedIdentifier()).append(
134: this .getVendorDetailAssignedIdentifier(),
135: vssc.getVendorDetailAssignedIdentifier()).append(
136: this .getVendorShippingSpecialConditionCode(),
137: vssc.getVendorShippingSpecialConditionCode())
138: .isEquals();
139: }
140: }
141:
142: /**
143: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
144: */
145: protected LinkedHashMap toStringMapper() {
146: LinkedHashMap m = new LinkedHashMap();
147: if (this .vendorHeaderGeneratedIdentifier != null) {
148: m.put("vendorHeaderGeneratedIdentifier",
149: this .vendorHeaderGeneratedIdentifier.toString());
150: }
151: if (this .vendorDetailAssignedIdentifier != null) {
152: m.put("vendorDetailAssignedIdentifier",
153: this .vendorDetailAssignedIdentifier.toString());
154: }
155: m.put("vendorShippingSpecialConditionCode",
156: this.vendorShippingSpecialConditionCode);
157:
158: return m;
159: }
160: }
|