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: package org.kuali.module.labor.util.testobject;
017:
018: import java.sql.Date;
019:
020: import org.apache.commons.lang.StringUtils;
021: import org.kuali.core.util.KualiDecimal;
022:
023: public class SimpleAddress {
024: private String street;
025: private String city;
026: private String state;
027: private Integer zip;
028: private KualiDecimal propertyValue;
029: private Date licenseDate;
030:
031: /**
032: * Constructs a SimpleAddress.java.
033: */
034: public SimpleAddress() {
035: this ("1000 Main Street", "Test City", "Kuali", 10000);
036: }
037:
038: /**
039: * Constructs a SimpleAddress.java.
040: */
041: public SimpleAddress(String street, String city, String state,
042: Integer zip) {
043: this (street, city, state, zip, KualiDecimal.ZERO, null);
044: }
045:
046: /**
047: * Constructs a SimpleAddress.java.
048: *
049: * @param street
050: * @param city
051: * @param state
052: * @param zip
053: * @param propertyValue
054: * @param licenseDate
055: */
056: public SimpleAddress(String street, String city, String state,
057: Integer zip, KualiDecimal propertyValue, Date licenseDate) {
058: this .street = street;
059: this .city = city;
060: this .state = state;
061: this .zip = zip;
062: this .propertyValue = propertyValue;
063: this .licenseDate = licenseDate;
064: }
065:
066: @Override
067: public boolean equals(Object object) {
068: if (!(object instanceof SimpleAddress))
069: return false;
070:
071: SimpleAddress that = (SimpleAddress) object;
072: if (!StringUtils.equals(this .getStreet(), that.getStreet())) {
073: return false;
074: } else if (!StringUtils.equals(this .getCity(), that.getCity())) {
075: return false;
076: } else if (!StringUtils
077: .equals(this .getState(), that.getState())) {
078: return false;
079: } else if (!StringUtils.equals(this .getZip().toString(), that
080: .getZip().toString())) {
081: return false;
082: }
083: return true;
084: }
085:
086: /**
087: * Gets the city attribute.
088: *
089: * @return Returns the city.
090: */
091: public String getCity() {
092: return city;
093: }
094:
095: /**
096: * Sets the city attribute value.
097: *
098: * @param city The city to set.
099: */
100: public void setCity(String city) {
101: this .city = city;
102: }
103:
104: /**
105: * Gets the state attribute.
106: *
107: * @return Returns the state.
108: */
109: public String getState() {
110: return state;
111: }
112:
113: /**
114: * Sets the state attribute value.
115: *
116: * @param state The state to set.
117: */
118: public void setState(String state) {
119: this .state = state;
120: }
121:
122: /**
123: * Gets the street attribute.
124: *
125: * @return Returns the street.
126: */
127: public String getStreet() {
128: return street;
129: }
130:
131: /**
132: * Sets the street attribute value.
133: *
134: * @param street The street to set.
135: */
136: public void setStreet(String street) {
137: this .street = street;
138: }
139:
140: /**
141: * Gets the zip attribute.
142: *
143: * @return Returns the zip.
144: */
145: public Integer getZip() {
146: return zip;
147: }
148:
149: /**
150: * Sets the zip attribute value.
151: *
152: * @param zip The zip to set.
153: */
154: public void setZip(Integer zip) {
155: this .zip = zip;
156: }
157:
158: /**
159: * Gets the licenseDate attribute.
160: *
161: * @return Returns the licenseDate.
162: */
163: public Date getLicenseDate() {
164: return licenseDate;
165: }
166:
167: /**
168: * Sets the licenseDate attribute value.
169: *
170: * @param licenseDate The licenseDate to set.
171: */
172: public void setLicenseDate(Date licenseDate) {
173: this .licenseDate = licenseDate;
174: }
175:
176: /**
177: * Gets the propertyValue attribute.
178: *
179: * @return Returns the propertyValue.
180: */
181: public KualiDecimal getPropertyValue() {
182: return propertyValue;
183: }
184:
185: /**
186: * Sets the propertyValue attribute value.
187: *
188: * @param propertyValue The propertyValue to set.
189: */
190: public void setPropertyValue(KualiDecimal propertyValue) {
191: this.propertyValue = propertyValue;
192: }
193: }
|