01: package com.silvermindsoftware.hitch.sample.model;
02:
03: /**
04: * User: brandongoodin
05: * Date: Mar 5, 2007
06: * Time: 12:15:28 PM
07: */
08: public class Vehicle {
09:
10: private Integer id;
11: private String type;
12:
13: public Vehicle() {
14: }
15:
16: public Vehicle(Integer id, String type) {
17: this .id = id;
18: this .type = type;
19: }
20:
21: public Integer getId() {
22: return id;
23: }
24:
25: public void setId(Integer id) {
26: this .id = id;
27: }
28:
29: public String getType() {
30: return type;
31: }
32:
33: public void setType(String type) {
34: this .type = type;
35: }
36:
37: public String toString() {
38: return type;
39: }
40:
41: public boolean equals(Object o) {
42: if (this == o)
43: return true;
44: if (o == null || getClass() != o.getClass())
45: return false;
46:
47: Vehicle vehicle = (Vehicle) o;
48:
49: if (id != null ? !id.equals(vehicle.id) : vehicle.id != null)
50: return false;
51: if (type != null ? !type.equals(vehicle.type)
52: : vehicle.type != null)
53: return false;
54:
55: return true;
56: }
57:
58: public int hashCode() {
59: int result;
60: result = (id != null ? id.hashCode() : 0);
61: result = 31 * result + (type != null ? type.hashCode() : 0);
62: return result;
63: }
64: }
|