-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCliente.java
More file actions
57 lines (45 loc) · 1.13 KB
/
Cliente.java
File metadata and controls
57 lines (45 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
public class Cliente {
private int id;
private String nome;
private String email;
public Cliente() {
}
public Cliente(int id, String nome, String email) {
this.id = id;
this.nome = nome;
this.email = email;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "Cliente{id=" + id + ", nome='" + nome + "', email='" + email + "'}";
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Cliente cliente = (Cliente) obj;
return id == cliente.id;
}
@Override
public int hashCode() {
return Integer.hashCode(id);
}
}