KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.objectweb.rentacar.persistance.bo;
2
3 import javax.xml.bind.annotation.AccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlType;
6
7 import org.apache.commons.lang.builder.EqualsBuilder;
8 import org.apache.commons.lang.builder.HashCodeBuilder;
9 import org.apache.commons.lang.builder.ToStringBuilder;
10
11 /**
12  *
13  * @author ofabre
14  *
15  */

16 @XmlAccessorType(AccessType.FIELD)
17 @XmlType(name = "carVO", propOrder = {
18     "brand",
19     "carId",
20     "model",
21     "type"
22 })
23 public class CarVO {
24     
25     private String JavaDoc carId;
26     
27     private String JavaDoc type;
28     
29     private String JavaDoc brand;
30     
31     private String JavaDoc model;
32
33     public CarVO() {
34         super();
35         // TODO Auto-generated constructor stub
36
}
37     
38     public CarVO(String JavaDoc type, String JavaDoc brand, String JavaDoc model) {
39         super();
40         this.type = type;
41         this.brand = brand;
42         this.model = model;
43     }
44
45     public CarVO(String JavaDoc carId, String JavaDoc type, String JavaDoc brand, String JavaDoc model) {
46         super();
47         this.carId = carId;
48         this.type = type;
49         this.brand = brand;
50         this.model = model;
51     }
52     
53     public CarVO(Car car) {
54         super();
55         this.carId = car.getCarId();
56         this.type = car.getType();
57         this.brand = car.getBrand();
58         this.model = car.getModel();
59     }
60
61     public String JavaDoc getBrand() {
62         return brand;
63     }
64
65     public void setBrand(String JavaDoc brand) {
66         this.brand = brand;
67     }
68
69     public String JavaDoc getCarId() {
70         return carId;
71     }
72
73     public void setCarId(String JavaDoc carId) {
74         this.carId = carId;
75     }
76
77     public String JavaDoc getModel() {
78         return model;
79     }
80
81     public void setModel(String JavaDoc model) {
82         this.model = model;
83     }
84
85     public String JavaDoc getType() {
86         return type;
87     }
88
89     public void setType(String JavaDoc type) {
90         this.type = type;
91     }
92
93     /**
94      * @see java.lang.Object#equals(Object)
95      */

96     public boolean equals(Object JavaDoc object) {
97         if (!(object instanceof CarVO)) {
98             return false;
99         }
100         CarVO rhs = (CarVO) object;
101         return new EqualsBuilder().append(this.brand, rhs.brand).append(
102                 this.type, rhs.type).append(
103                 this.model, rhs.model).append(this.carId, rhs.carId).isEquals();
104     }
105
106     /**
107      * @see java.lang.Object#hashCode()
108      */

109     public int hashCode() {
110         return new HashCodeBuilder(-1168981869, -109522229).append(this.brand)
111                 .append(this.type).append(this.model)
112                 .append(this.carId).toHashCode();
113     }
114
115     /**
116      * @see java.lang.Object#toString()
117      */

118     public String JavaDoc toString() {
119         return new ToStringBuilder(this).append("model", this.model).append(
120                 "carId", this.carId).append(
121                 "type", this.type).append(
122                 "brand", this.brand).toString();
123     }
124     
125     
126
127 }
128
Popular Tags