Search in sources :

Example 16 with EmailDTO

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;
}
Also used : TelefoneDTO(com.tomasio.projects.trainning.dto.TelefoneDTO) PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) EmailDTO(com.tomasio.projects.trainning.dto.EmailDTO) EnderecoDTO(com.tomasio.projects.trainning.dto.EnderecoDTO)

Example 17 with EmailDTO

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;
}
Also used : EmailDTO(com.tomasio.projects.trainning.dto.EmailDTO)

Aggregations

EmailDTO (com.tomasio.projects.trainning.dto.EmailDTO)17 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)14 TelefoneDTO (com.tomasio.projects.trainning.dto.TelefoneDTO)11 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)10 ArrayList (java.util.ArrayList)7 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)4 HabilitacaoInstrutorEfetivaDTO (com.tomasio.projects.trainning.dto.HabilitacaoInstrutorEfetivaDTO)3 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)3 PessoaForm (com.tomasio.projects.trainning.form.PessoaForm)3 CoreException (com.tomasio.projects.trainning.exeption.CoreException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 CursoDTO (com.tomasio.projects.trainning.dto.CursoDTO)1 EnderecoDTO (com.tomasio.projects.trainning.dto.EnderecoDTO)1 PeriodoDTO (com.tomasio.projects.trainning.dto.PeriodoDTO)1 HabilitacaoInstrutorForm (com.tomasio.projects.trainning.form.instrutores.HabilitacaoInstrutorForm)1 PropostaHabilitacaoInstrutorForm (com.tomasio.projects.trainning.form.instrutores.PropostaHabilitacaoInstrutorForm)1 ParseException (java.text.ParseException)1