Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
/*
2
 * Copyright 2009-2014 PrimeTek.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package org.primefaces.ultima.domain;
17
 
18
import java.io.Serializable;
19
 
20
public class Car implements Serializable {
21
 
22
    public String id;
23
    public String brand;
24
    public int year;
25
    public String color;
26
    public int price;
27
    public boolean sold;
28
 
29
    public Car() {}
30
 
31
    public Car(String id, String brand, int year, String color) {
32
        this.id = id;
33
        this.brand = brand;
34
        this.year = year;
35
        this.color = color;
36
    }
37
 
38
    public Car(String id, String brand, int year, String color, int price, boolean sold) {
39
        this.id = id;
40
        this.brand = brand;
41
        this.year = year;
42
        this.color = color;
43
        this.price = price;
44
        this.sold = sold;
45
    }
46
 
47
    public String getId() {
48
        return id;
49
    }
50
    public void setId(String id) {
51
        this.id = id;
52
    }
53
 
54
    public String getBrand() {
55
        return brand;
56
    }
57
    public void setBrand(String brand) {
58
        this.brand = brand;
59
    }
60
 
61
    public int getYear() {
62
        return year;
63
    }
64
    public void setYear(int year) {
65
        this.year = year;
66
    }
67
 
68
    public String getColor() {
69
        return color;
70
    }
71
    public void setColor(String color) {
72
        this.color = color;
73
    }
74
 
75
    public int getPrice() {
76
        return price;
77
    }
78
    public void setPrice(int price) {
79
        this.price = price;
80
    }
81
 
82
    public boolean isSold() {
83
        return sold;
84
    }
85
    public void setSold(boolean sold) {
86
        this.sold = sold;
87
    }
88
 
89
    @Override
90
    public int hashCode() {
91
        int hash = 7;
92
        hash = 59 * hash + (this.id != null ? this.id.hashCode() : 0);
93
        return hash;
94
    }
95
 
96
    @Override
97
    public boolean equals(Object obj) {
98
        if (obj == null) {
99
            return false;
100
        }
101
        if (getClass() != obj.getClass()) {
102
            return false;
103
        }
104
        final Car other = (Car) obj;
105
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
106
            return false;
107
        }
108
        return true;
109
    }
110
}