-
Notifications
You must be signed in to change notification settings - Fork 1
/
Usuario.java
49 lines (38 loc) · 961 Bytes
/
Usuario.java
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
package modelo;
import java.util.Objects;
public class Usuario {
private final long cpf;
private String nome;
private String endereco;
public Usuario(String nome, long cpf, String endereco) {
this.nome = nome;
this.cpf = cpf;
this.endereco = endereco;
}
public long getCpf() {
return cpf;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEndereco() {
return endereco;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Usuario usuario = (Usuario) o;
return cpf == usuario.cpf;
}
@Override
public int hashCode() {
return Objects.hash(cpf);
}
}