Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.gov.al.saude.srv.model.dto; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.Date; |
||
| 5 | |||
| 6 | import br.gov.al.saude.framework.core.util.DocumentoUtils; |
||
| 7 | import br.gov.al.saude.srv.model.enums.TipoSituacaoCadastral; |
||
| 8 | |||
| 9 | public class ServidorDTO implements Serializable { |
||
| 10 | |||
| 11 | private static final long serialVersionUID = 1L; |
||
| 12 | |||
| 13 | private Long sequencialPessoa; |
||
| 14 | private String cpf; |
||
| 15 | private String nome; |
||
| 16 | private TipoSituacaoCadastral tipoSituacaoCadastral; |
||
| 17 | private String nomeUsuarioCadastro; |
||
| 18 | private String nomeUsuarioUltimaAlteracaoCadastral; |
||
| 19 | private Date dataHoraAlteracao; |
||
| 20 | |||
| 21 | public ServidorDTO(Long sequencialPessoa, String cpf, String nome, String tipoSituacaoCadastral, |
||
| 22 | String nomeUsuarioCadastro, String nomeUsuarioUltimaAlteracaoCadastral, Date dataHoraAlteracao ) { |
||
| 23 | setSequencialPessoa(sequencialPessoa); |
||
| 24 | setCpf(cpf); |
||
| 25 | setNome(nome); |
||
| 26 | setTipoSituacaoCadastral(tipoSituacaoCadastral); |
||
| 27 | setNomeUsuarioCadastro(nomeUsuarioCadastro); |
||
| 28 | setNomeUsuarioUltimaAlteracaoCadastral(nomeUsuarioUltimaAlteracaoCadastral); |
||
| 29 | setDataHoraAlteracao(dataHoraAlteracao); |
||
| 30 | } |
||
| 31 | |||
| 32 | public ServidorDTO() {} |
||
| 33 | |||
| 34 | public Long getSequencialPessoa() { |
||
| 35 | return sequencialPessoa; |
||
| 36 | } |
||
| 37 | |||
| 38 | public void setSequencialPessoa(Long sequencialPessoa) { |
||
| 39 | this.sequencialPessoa = sequencialPessoa; |
||
| 40 | } |
||
| 41 | |||
| 42 | public String getCpfFormatado() { |
||
| 43 | try { |
||
| 44 | return DocumentoUtils.adicionarMascaraCpf(getCpf()); |
||
| 45 | } catch (Exception e) { |
||
| 46 | return getCpf(); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | public String getCpf() { |
||
| 51 | return cpf; |
||
| 52 | } |
||
| 53 | |||
| 54 | public void setCpf(String cpf) { |
||
| 55 | this.cpf = cpf; |
||
| 56 | } |
||
| 57 | |||
| 58 | public String getNome() { |
||
| 59 | return nome; |
||
| 60 | } |
||
| 61 | |||
| 62 | public void setNome(String nome) { |
||
| 63 | this.nome = nome; |
||
| 64 | } |
||
| 65 | |||
| 66 | public TipoSituacaoCadastral getTipoSituacaoCadastral() { |
||
| 67 | return tipoSituacaoCadastral; |
||
| 68 | } |
||
| 69 | |||
| 70 | public void setTipoSituacaoCadastral(String tipoSituacaoCadastral) { |
||
| 71 | this.tipoSituacaoCadastral = TipoSituacaoCadastral.parse(tipoSituacaoCadastral); |
||
| 72 | } |
||
| 73 | |||
| 74 | public String getDescricaoTipoSituacaoCadastral() { |
||
| 75 | return getTipoSituacaoCadastral().getDescricao(); |
||
| 76 | } |
||
| 77 | |||
| 78 | public String getNomeUsuarioCadastro() { |
||
| 79 | return nomeUsuarioCadastro; |
||
| 80 | } |
||
| 81 | |||
| 82 | public void setNomeUsuarioCadastro(String nomeUsuarioCadastro) { |
||
| 83 | this.nomeUsuarioCadastro = nomeUsuarioCadastro; |
||
| 84 | } |
||
| 85 | |||
| 86 | public String getNomeUsuarioUltimaAlteracaoCadastral() { |
||
| 87 | return nomeUsuarioUltimaAlteracaoCadastral; |
||
| 88 | } |
||
| 89 | |||
| 90 | public void setNomeUsuarioUltimaAlteracaoCadastral(String nomeUsuarioUltimaAlteracaoCadastral) { |
||
| 91 | this.nomeUsuarioUltimaAlteracaoCadastral = nomeUsuarioUltimaAlteracaoCadastral; |
||
| 92 | } |
||
| 93 | |||
| 94 | public Date getDataHoraAlteracao() { |
||
| 95 | return dataHoraAlteracao; |
||
| 96 | } |
||
| 97 | |||
| 98 | public void setDataHoraAlteracao(Date dataHoraAlteracao) { |
||
| 99 | this.dataHoraAlteracao = dataHoraAlteracao; |
||
| 100 | } |
||
| 101 | |||
| 102 | @Override |
||
| 103 | public int hashCode() { |
||
| 104 | final int prime = 31; |
||
| 105 | int result = 1; |
||
| 106 | result = prime |
||
| 107 | * result |
||
| 108 | + ((sequencialPessoa == null) ? 0 : sequencialPessoa.hashCode()); |
||
| 109 | return result; |
||
| 110 | } |
||
| 111 | |||
| 112 | @Override |
||
| 113 | public boolean equals(Object obj) { |
||
| 114 | if (this == obj) |
||
| 115 | return true; |
||
| 116 | if (obj == null) |
||
| 117 | return false; |
||
| 118 | if (getClass() != obj.getClass()) |
||
| 119 | return false; |
||
| 120 | ServidorDTO other = (ServidorDTO) obj; |
||
| 121 | if (sequencialPessoa == null) { |
||
| 122 | if (other.sequencialPessoa != null) |
||
| 123 | return false; |
||
| 124 | } else if (!sequencialPessoa.equals(other.sequencialPessoa)) |
||
| 125 | return false; |
||
| 126 | return true; |
||
| 127 | } |
||
| 128 | } |