View Javadoc

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