use of com.tomasio.projects.trainning.dto.EmailDTO in project trainning by fernandotomasio.
the class Pessoa method createDTO.
@Override
public PessoaDTO createDTO() {
PessoaDTO dto = createDTOWithoutDependencies();
if (organizacao != null) {
dto.setOrganizacao(organizacao.createDTOWithoutDependencies());
}
if (telefones != null) {
TelefoneDTO[] dtoArray = new TelefoneDTO[telefones.size()];
Object[] modelArray = telefones.toArray();
for (int i = 0; i < modelArray.length; i++) {
Telefone telefone = (Telefone) modelArray[i];
dtoArray[i] = telefone.createDTOWithoutDependencies();
}
dto.setTelefones(dtoArray);
}
if (emails != null) {
EmailDTO[] dtoArray = new EmailDTO[emails.size()];
Object[] modelArray = emails.toArray();
for (int i = 0; i < modelArray.length; i++) {
Email email = (Email) modelArray[i];
dtoArray[i] = email.createDTOWithoutDependencies();
}
dto.setEmails(dtoArray);
}
if (enderecos != null) {
EnderecoDTO[] dtoArray = new EnderecoDTO[enderecos.size()];
Object[] modelArray = enderecos.toArray();
for (int i = 0; i < modelArray.length; i++) {
Endereco endereco = (Endereco) modelArray[i];
dtoArray[i] = endereco.createDTOWithoutDependencies();
}
dto.setEnderecos(dtoArray);
}
return dto;
}
use of com.tomasio.projects.trainning.dto.EmailDTO in project trainning by fernandotomasio.
the class Email method createDTOMinimal.
public EmailDTO createDTOMinimal() {
EmailDTO dto = new EmailDTO();
dto.setAddress(address);
dto.setPreference(preference);
return dto;
}
Aggregations