-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPessoa.java
More file actions
130 lines (94 loc) · 2.24 KB
/
Copy pathPessoa.java
File metadata and controls
130 lines (94 loc) · 2.24 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import java.util.List;
public class Pessoa {
private int id;
private String nome, dataNascimento, cpf, rg;
private char sexo;
private List<String> Emails;
private List<String> Telefones;
private List<Endereco> Enderecos;
public Pessoa(int id, String nome, String dataNascimento, String cpf, String rg) {
this.id = id;
this.nome = nome;
this.dataNascimento = dataNascimento;
this.cpf = cpf;
this.rg = rg;
}
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 getDataNascimento() {
return dataNascimento;
}
public boolean setDataNascimento(String dataNascimento) {
if (!Utilidades.validarData(dataNascimento))
return false;
this.dataNascimento = dataNascimento;
return true;
}
public String getCpf() {
return cpf;
}
public boolean setCpf(String cpf) {
if (!Utilidades.validarCPF(cpf))
return false;
this.cpf = cpf;
return true;
}
public String getRg() {
return rg;
}
public void setRg(String rg) {
this.rg = rg;
}
public char getSexo() {
return sexo;
}
public void setSexo(char sexo) {
this.sexo = sexo;
}
public List<String> getEmails() {
return Emails;
}
public boolean adicionarEmail(String email) {
if (this.Emails.contains(email))
return false;
this.Emails.add(email);
return true;
}
public boolean removerEmail(String email) {
if (!this.Emails.contains(email))
return false;
this.Emails.remove(email);
return true;
}
public List<String> getTelefones() {
return Telefones;
}
public boolean adicionarTelefone(String telefone) {
if (this.Telefones.contains(telefone))
return false;
this.Telefones.add(telefone);
return true;
}
public boolean removerTelefone(String telefone) {
if (!this.Telefones.contains(telefone))
return false;
this.Telefones.remove(telefone);
return true;
}
public List<Endereco> getEnderecos() {
return Enderecos;
}
public void setEnderecos(List<Endereco> enderecos) {
Enderecos = enderecos;
}
}