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.3 $ - $Date: 2005/12/20 15:36:45 $
29 */
30 public abstract class ServiceOffer extends Offer {
31
32 /***
33 * costPerDay
34 */
35 private double costPerDay = 0.0d;
36
37 /***
38 * empty constructor, needed by hibernate.
39 */
40 public ServiceOffer() {
41 super();
42 }
43
44 /***
45 *
46 * @return costPerDay double
47 */
48 public double getCostPerDay() {
49 return costPerDay;
50 }
51
52 /***
53 *
54 * @param costPerDay double
55 */
56 public void setCostPerDay(double costPerDay) {
57 this.costPerDay = costPerDay;
58 }
59
60 /***
61 * {@inheritDoc}
62 */
63 public int compareTo(Object o) {
64 ServiceOffer serviceOffer = (ServiceOffer) o;
65 return new CompareToBuilder()
66 .appendSuper(super.compareTo(o))
67 .append(this.costPerDay, serviceOffer.getCostPerDay())
68 .toComparison();
69 }
70
71
72 /***
73 * {@inheritDoc}
74 */
75 public boolean equals(Object o) {
76 if (!(o instanceof ServiceOffer)) {
77 return false;
78 }
79 if (this == o) {
80 return true;
81 }
82 ServiceOffer serviceOffer = (ServiceOffer) o;
83 return new EqualsBuilder()
84 .appendSuper(super.equals(o))
85 .append(this.costPerDay, serviceOffer.getCostPerDay())
86 .isEquals();
87 }
88
89
90 /***
91 * {@inheritDoc}
92 */
93 public int hashCode() {
94 return new HashCodeBuilder(777, 33)
95 .append(this.costPerDay)
96 .toHashCode();
97 }
98
99
100 /***
101 * {@inheritDoc}
102 */
103 public String toString() {
104 return new ToStringBuilder(this)
105 .appendSuper(super.toString())
106 .append("costPerDay", this.costPerDay)
107 .toString();
108 }
109 }
110 /***
111 * $Log: ServiceOffer.java,v $
112 * Revision 1.3 2005/12/20 15:36:45 shally
113 * CheckStyle and PMD changes.
114 *
115 * Revision 1.2 2005/08/31 12:15:09 bme_jcs
116 * refactoring and introduction of apache builders
117 *
118 * Revision 1.1 2005/08/26 07:58:26 ge0ffrey
119 * split up the sources in service, serviceimpl and webclient
120 *
121 * Revision 1.2 2005/06/09 08:18:52 bejug_cc
122 * Fix initial import
123 *
124 * Revision 1.4 2005/05/09 14:54:45 ssc
125 * checkstyle
126 *
127 * Revision 1.3 2005/04/29 18:17:34 sja
128 * General cleanup (naming conv., javadoc and CVS tags)
129 *
130 * Revision 1.2 2005/04/29 07:01:47 PSONG09
131 * update
132 * Revision 1.1 2005/04/25 08:05:40 bme First
133 * Release
134 *
135 */