View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.vnd.businessobject;
18  
19  import java.util.LinkedHashMap;
20  
21  import org.apache.commons.lang.builder.EqualsBuilder;
22  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
23  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24  import org.kuali.rice.krad.util.ObjectUtils;
25  
26  /**
27   * Relationship between a Vendor and a <code>ShippingSpecialCondition</code>.
28   * 
29   * @see org.kuali.ole.vnd.businessobject.ShippingSpecialCondition
30   */
31  public class VendorShippingSpecialCondition extends PersistableBusinessObjectBase implements VendorRoutingComparable, MutableInactivatable {
32  
33      private Integer vendorHeaderGeneratedIdentifier;
34      private Integer vendorDetailAssignedIdentifier;
35      private String vendorShippingSpecialConditionCode;
36      private boolean active;
37  
38      private VendorDetail vendorDetail;
39      private ShippingSpecialCondition vendorShippingSpecialCondition;
40  
41      /**
42       * Default constructor.
43       */
44      public VendorShippingSpecialCondition() {
45  
46      }
47  
48      public Integer getVendorHeaderGeneratedIdentifier() {
49  
50          return vendorHeaderGeneratedIdentifier;
51      }
52  
53      public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
54          this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
55      }
56  
57      public Integer getVendorDetailAssignedIdentifier() {
58  
59          return vendorDetailAssignedIdentifier;
60      }
61  
62      public void setVendorDetailAssignedIdentifier(Integer vendorDetailAssignedIdentifier) {
63          this.vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
64      }
65  
66      public String getVendorShippingSpecialConditionCode() {
67  
68          return vendorShippingSpecialConditionCode;
69      }
70  
71      public void setVendorShippingSpecialConditionCode(String vendorShippingSpecialConditionCode) {
72          this.vendorShippingSpecialConditionCode = vendorShippingSpecialConditionCode;
73      }
74  
75      public boolean isActive() {
76  
77          return active;
78      }
79  
80      public void setActive(boolean active) {
81          this.active = active;
82      }
83  
84      public VendorDetail getVendorDetail() {
85  
86          return vendorDetail;
87      }
88  
89      /**
90       * Sets the vendorDetail attribute value.
91       * 
92       * @param vendorDetail The vendorDetail to set.
93       * @deprecated
94       */
95      public void setVendorDetail(VendorDetail vendorDetail) {
96          this.vendorDetail = vendorDetail;
97      }
98  
99      public ShippingSpecialCondition getVendorShippingSpecialCondition() {
100 
101         return vendorShippingSpecialCondition;
102     }
103 
104     /**
105      * Sets the vendorShippingSpecialCondition attribute value.
106      * 
107      * @param vendorShippingSpecialCondition The vendorShippingSpecialCondition to set.
108      * @deprecated
109      */
110     public void setVendorShippingSpecialCondition(ShippingSpecialCondition vendorShippingSpecialCondition) {
111         this.vendorShippingSpecialCondition = vendorShippingSpecialCondition;
112     }
113 
114     /**
115      * @see org.kuali.ole.vnd.document.routing.VendorRoutingComparable#isEqualForRouting(java.lang.Object)
116      */
117     public boolean isEqualForRouting(Object toCompare) {
118         if ((ObjectUtils.isNull(toCompare)) || !(toCompare instanceof VendorShippingSpecialCondition)) {
119             return false;
120         }
121         else {
122             VendorShippingSpecialCondition vssc = (VendorShippingSpecialCondition) toCompare;
123 
124             return new EqualsBuilder().append(this.getVendorHeaderGeneratedIdentifier(), vssc.getVendorHeaderGeneratedIdentifier()).append(this.getVendorDetailAssignedIdentifier(), vssc.getVendorDetailAssignedIdentifier()).append(this.getVendorShippingSpecialConditionCode(), vssc.getVendorShippingSpecialConditionCode()).isEquals();
125         }
126     }
127 
128     /**
129      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
130      */
131     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
132         LinkedHashMap m = new LinkedHashMap();
133         if (this.vendorHeaderGeneratedIdentifier != null) {
134             m.put("vendorHeaderGeneratedIdentifier", this.vendorHeaderGeneratedIdentifier.toString());
135         }
136         if (this.vendorDetailAssignedIdentifier != null) {
137             m.put("vendorDetailAssignedIdentifier", this.vendorDetailAssignedIdentifier.toString());
138         }
139         m.put("vendorShippingSpecialConditionCode", this.vendorShippingSpecialConditionCode);
140 
141         return m;
142     }
143 }