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 edu.sampleu.financial.bo;
18  
19  import java.util.LinkedHashMap;
20  
21  import org.apache.commons.lang.builder.EqualsBuilder;
22  import org.kuali.rice.kns.bo.Inactivateable;
23  import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
24  import org.kuali.rice.kns.util.ObjectUtils;
25  
26  /**
27   * An association between a <code>Campus</code> and a <code>VendorAddress</code> to indicate that the Address is the default one
28   * for this Campus among the various Addresses available for this Vendor.
29   *
30   * @see org.kuali.rice.kns.bo.Campus
31   * @see org.kuali.kfs.vnd.businessobject.VendorAddress
32   */
33  public class VendorDefaultAddress extends PersistableBusinessObjectBase implements Inactivateable {
34  
35      private Integer vendorDefaultAddressGeneratedIdentifier;
36      private Integer vendorAddressGeneratedIdentifier;
37      private String vendorCampusCode;
38      private boolean active;
39  
40      private VendorAddress vendorAddress;
41  
42      /**
43       * Default constructor.
44       */
45      public VendorDefaultAddress() {
46          super();
47      }
48  
49      public String getVendorCampusCode() {
50  
51          return vendorCampusCode;
52      }
53  
54      public void setVendorCampusCode(String vendorCampusCode) {
55          this.vendorCampusCode = vendorCampusCode;
56      }
57  
58      public Integer getVendorAddressGeneratedIdentifier() {
59  
60          return vendorAddressGeneratedIdentifier;
61      }
62  
63      public void setVendorAddressGeneratedIdentifier(Integer vendorAddressGeneratedIdentifier) {
64          this.vendorAddressGeneratedIdentifier = vendorAddressGeneratedIdentifier;
65      }
66  
67      public boolean isActive() {
68  
69          return active;
70      }
71  
72      public void setActive(boolean active) {
73          this.active = active;
74      }
75  
76      public VendorAddress getVendorAddress() {
77  
78          return vendorAddress;
79      }
80  
81      /**
82       * Sets the vendorAddress attribute.
83       *
84       * @param vendorAddress The vendorAddress to set.
85       * @deprecated
86       */
87      public void setVendorAddress(VendorAddress vendorAddress) {
88          this.vendorAddress = vendorAddress;
89      }
90  
91      public Integer getVendorDefaultAddressGeneratedIdentifier() {
92  
93          return vendorDefaultAddressGeneratedIdentifier;
94      }
95  
96      public void setVendorDefaultAddressGeneratedIdentifier(Integer vendorDefaultAddressGeneratedIdentifier) {
97          this.vendorDefaultAddressGeneratedIdentifier = vendorDefaultAddressGeneratedIdentifier;
98      }
99  
100     /**
101      * @see org.kuali.kfs.vnd.document.routing.VendorRoutingComparable#isEqualForRouting(Object)
102      */
103     public boolean isEqualForRouting(Object toCompare) {
104         if ((ObjectUtils.isNull(toCompare)) || !(toCompare instanceof VendorDefaultAddress)) {
105 
106             return false;
107         } else {
108             VendorDefaultAddress vda = (VendorDefaultAddress) toCompare;
109 
110             return new EqualsBuilder().append(this.getVendorDefaultAddressGeneratedIdentifier(), vda.getVendorDefaultAddressGeneratedIdentifier()).append(this.getVendorAddressGeneratedIdentifier(), vda.getVendorAddressGeneratedIdentifier()).append(this.getVendorCampusCode(), vda.getVendorCampusCode()).isEquals();
111         }
112     }
113 
114 
115 }