KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rentacar > persistance > bo > AgencyCriteria


1 package org.objectweb.rentacar.persistance.bo;
2
3 import org.apache.commons.lang.builder.EqualsBuilder;
4 import org.apache.commons.lang.builder.HashCodeBuilder;
5 import org.apache.commons.lang.builder.ToStringBuilder;
6
7 /**
8  * A list of criteria to retrieve specific agencies
9  * @author ofabre
10  *
11  */

12 public class AgencyCriteria {
13     
14     private String JavaDoc agencyId;
15     
16     private String JavaDoc zipPattern;
17     
18     private String JavaDoc lastName;
19
20     public AgencyCriteria() {
21         super();
22     }
23     
24     public AgencyCriteria(String JavaDoc agencyId, String JavaDoc zipPattern, String JavaDoc lastName) {
25         super();
26         // TODO Auto-generated constructor stub
27
this.zipPattern = zipPattern;
28         this.lastName = lastName;
29     }
30
31     public String JavaDoc getLastName() {
32         return lastName;
33     }
34
35     public void setLastName(String JavaDoc lastName) {
36         this.lastName = lastName;
37     }
38
39     public String JavaDoc getZipPattern() {
40         return zipPattern;
41     }
42
43     public void setZipPattern(String JavaDoc zipPattern) {
44         this.zipPattern = zipPattern;
45     }
46
47     public String JavaDoc getAgencyId() {
48         return agencyId;
49     }
50
51     public void setAgencyId(String JavaDoc agencyId) {
52         this.agencyId = agencyId;
53     }
54
55     /**
56      * @see java.lang.Object#equals(Object)
57      */

58     public boolean equals(Object JavaDoc object) {
59         if (!(object instanceof AgencyCriteria)) {
60             return false;
61         }
62         AgencyCriteria rhs = (AgencyCriteria) object;
63         return new EqualsBuilder().append(this.zipPattern, rhs.zipPattern)
64                 .append(this.agencyId, rhs.agencyId).append(this.lastName,
65                         rhs.lastName).isEquals();
66     }
67
68     /**
69      * @see java.lang.Object#hashCode()
70      */

71     public int hashCode() {
72         return new HashCodeBuilder(1916301059, 2054063585).append(
73                 this.zipPattern).append(this.agencyId).append(this.lastName)
74                 .toHashCode();
75     }
76
77     /**
78      * @see java.lang.Object#toString()
79      */

80     public String JavaDoc toString() {
81         return new ToStringBuilder(this).append("lastName", this.lastName)
82                 .append("agencyId", this.agencyId).append("zipPattern",
83                         this.zipPattern).toString();
84     }
85     
86     
87
88 }
89
Popular Tags