View Javadoc

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   * @author Bart Meyers (Last modified by $Author: shally $)
27   * @version $Revision: 1.3 $ - $Date: 2005/12/20 15:36:45 $)
28   */
29  public class ConsultingServiceOffer extends ServiceOffer {
30  
31      /***
32       * minDuration
33       */ 
34      private int minDuration = 0;
35  
36      /***
37       * maxDuration
38       */
39      private int maxDuration = 0;
40  
41      /***
42       * default constructor, needed by hibernate
43       */
44      public ConsultingServiceOffer() {
45          super();
46      }
47  
48      /***
49       *
50       * @return maxDuration int
51       */
52      public int getMaxDuration() {
53          return maxDuration;
54      }
55  
56      /***
57       *
58       * @param maxDuration int
59       */
60      public void setMaxDuration(int maxDuration) {
61          this.maxDuration = maxDuration;
62      }
63  
64      /***
65       *
66       * @return minDuration int
67       */
68      public int getMinDuration() {
69          return minDuration;
70      }
71  
72      /***
73       *
74       * @param minDuration int
75       */
76      public void setMinDuration(int minDuration) {
77          this.minDuration = minDuration;
78      }
79      
80      /***
81       * {@inheritDoc}
82       */
83      public boolean equals(Object o) {
84      	if (!(o instanceof ConsultingServiceOffer)) {
85      	     return false;
86      	   }
87      	   if (this == o) {
88      	     return true;
89      	   }
90      	   ConsultingServiceOffer cso = (ConsultingServiceOffer) o;
91      	   return new EqualsBuilder()
92      	   		.appendSuper(super.equals(o))
93      	   		.append(this.minDuration, cso.getMinDuration())
94      	   		.append(this.maxDuration, cso.getMaxDuration())
95      	        .isEquals();
96      }
97      
98      
99      /***
100      * {@inheritDoc}
101      */
102     public int hashCode() {
103         return new HashCodeBuilder(67, 89)
104           .append(this.minDuration)
105           .append(this.maxDuration)
106           .toHashCode();
107     }
108     
109     
110     /***
111      * {@inheritDoc}
112      */
113     public int compareTo(Object o) {
114         ConsultingServiceOffer cso = (ConsultingServiceOffer) o;
115         return new CompareToBuilder()
116           .appendSuper(super.compareTo(cso))
117           .append(this.minDuration, cso.getMinDuration())
118     	  .append(this.maxDuration, cso.getMaxDuration())
119           .toComparison();
120     }
121     
122     
123     /***
124      * {@inheritDoc}
125      */
126     public String toString() {
127     	return new ToStringBuilder(this)
128     		.appendSuper(super.toString())
129     		.append("minDuration", this.minDuration)
130     		.append("maxDuration", this.maxDuration)    		
131     		.toString();
132     }
133 }
134 /***
135  * $Log: ConsultingServiceOffer.java,v $
136  * Revision 1.3  2005/12/20 15:36:45  shally
137  * CheckStyle and PMD changes.
138  *
139  * Revision 1.2  2005/08/31 12:15:09  bme_jcs
140  * refactoring and introduction of apache builders
141  *
142  * Revision 1.1  2005/08/26 07:58:26  ge0ffrey
143  * split up the sources in service, serviceimpl and webclient
144  *
145  * Revision 1.2  2005/06/09 08:18:52  bejug_cc
146  * Fix initial import
147  *
148  * Revision 1.4  2005/05/09 13:42:10  ssc
149  * checkstyle
150  *
151  * Revision 1.3  2005/04/29 18:17:34  sja
152  * General cleanup (naming conv., javadoc and CVS tags)
153  *
154  * Revision 1.2  2005/04/29 06:01:57  bme
155  * members vars updated
156  *
157  * Revision 1.1  2005/04/25 08:04:41  bme
158  * First Release
159  *
160  */