1 /***
2 Copyright (C) 2005 The Java Community
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 2 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 Place, Suite 330, Boston, MA 02111-1307 USA.
16
17 */
18 package org.bejug.javacareers.jobs.model;
19
20 import org.apache.commons.lang.builder.CompareToBuilder;
21 import org.apache.commons.lang.builder.EqualsBuilder;
22 import org.apache.commons.lang.builder.HashCodeBuilder;
23 import org.apache.commons.lang.builder.ToStringBuilder;
24
25 /***
26 *
27 * @author Bart Meyers (Last modified by $Author: shally $)
28 * @version $Revision: 1.4 $ - $Date: 2005/12/20 15:36:45 $
29 */
30 public abstract class EducationOffer extends Offer {
31
32
33 /***
34 * the address where the education takes place.
35 */
36 private Address address = null;
37
38 /***
39 * the cost of the educationOffer.
40 */
41 private Double cost = null;
42
43 /***
44 * Default constructor.
45 */
46 public EducationOffer() {
47 super();
48 }
49
50 /***
51 *
52 * @return The cost to return.
53 */
54 public Double getCost() {
55 return cost;
56 }
57
58
59 /***
60 * @param cost The cost to set.
61 */
62 public void setCost(Double cost) {
63 this.cost = cost;
64 }
65
66
67 /***
68 * @return the wanted address.
69 */
70 public Address getAddress() {
71 return address;
72 }
73
74 /***
75 * sets the address.
76 * @param address the address to set.
77 */
78 public void setAddress(Address address) {
79 this.address = address;
80 }
81
82 /***
83 * {@inheritDoc}
84 */
85 public boolean equals(Object o) {
86 if (!(o instanceof EducationOffer)) {
87 return false;
88 }
89 if (this == o) {
90 return true;
91 }
92 EducationOffer eduOffer = (EducationOffer) o;
93 return new EqualsBuilder()
94 .appendSuper(super.equals(o))
95 .append(this.address, eduOffer.getAddress())
96 .append(this.cost, eduOffer.getCost())
97 .isEquals();
98 }
99
100
101 /***
102 * {@inheritDoc}
103 */
104 public int hashCode() {
105 return new HashCodeBuilder(63, 189)
106 .append(this.address)
107 .append(this.cost)
108 .toHashCode();
109 }
110
111
112 /***
113 * {@inheritDoc}
114 */
115 public int compareTo(Object o) {
116 EducationOffer eduOffer = (EducationOffer) o;
117 return new CompareToBuilder()
118 .appendSuper(super.compareTo(eduOffer))
119 .append(this.address, eduOffer.getAddress())
120 .append(this.cost, eduOffer.getCost())
121 .toComparison();
122 }
123
124
125 /***
126 * {@inheritDoc}
127 */
128 public String toString() {
129 return new ToStringBuilder(super.toString())
130 .appendSuper("Offer")
131 .append("address", this.address)
132 .append("cost", this.cost)
133 .toString();
134 }
135 }
136 /***
137 * $Log: EducationOffer.java,v $
138 * Revision 1.4 2005/12/20 15:36:45 shally
139 * CheckStyle and PMD changes.
140 *
141 * Revision 1.3 2005/09/09 10:54:03 bavo_jcs
142 * Added CommercialEducationOffer
143 *
144 * Revision 1.2 2005/08/31 12:15:09 bme_jcs
145 * refactoring and introduction of apache builders
146 *
147 * Revision 1.1 2005/08/26 07:58:26 ge0ffrey
148 * split up the sources in service, serviceimpl and webclient
149 *
150 * Revision 1.2 2005/06/09 08:18:52 bejug_cc
151 * Fix initial import
152 *
153 * Revision 1.4 2005/05/10 13:54:41 bme
154 * added address
155 *
156 * Revision 1.3 2005/05/03 14:52:17 PSONG09
157 * javadoc added
158 *
159 * Revision 1.2 2005/04/29 18:17:34 sja
160 * General cleanup (naming conv., javadoc and CVS tags)
161 *
162 * Revision 1.1 2005/04/29 05:59:53 bme
163 * first release
164 *
165 */