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 | |||
| 5 | import br.gov.al.saude.framework.core.util.VerificadorUtil; |
||
| 6 | import br.gov.al.saude.srv.model.GrauInstrucao; |
||
| 7 | |||
| 8 | public class CargoDTO implements Serializable { |
||
| 9 | |||
| 10 | private static final String NAO_SE_APLICA = "N/A"; |
||
| 11 | |||
| 12 | private static final long serialVersionUID = 1L; |
||
| 13 | private Integer codigo; |
||
| 14 | private String descricao; |
||
| 15 | private GrauInstrucao grauInstrucao; |
||
| 16 | private Long quantidadeVagas; |
||
| 17 | private Long quantidadeVagasOcupadas; |
||
| 18 | |||
| 19 | public Integer getCodigo() { |
||
| 20 | return codigo; |
||
| 21 | } |
||
| 22 | |||
| 23 | public void setCodigo(Integer codigo) { |
||
| 24 | this.codigo = codigo; |
||
| 25 | } |
||
| 26 | |||
| 27 | public String getDescricao() { |
||
| 28 | return descricao; |
||
| 29 | } |
||
| 30 | |||
| 31 | public void setDescricao(String descricao) { |
||
| 32 | this.descricao = descricao; |
||
| 33 | } |
||
| 34 | |||
| 35 | public GrauInstrucao getGrauInstrucao() { |
||
| 36 | return grauInstrucao; |
||
| 37 | } |
||
| 38 | |||
| 39 | public void setGrauInstrucao(GrauInstrucao grauInstrucao) { |
||
| 40 | this.grauInstrucao = grauInstrucao; |
||
| 41 | } |
||
| 42 | |||
| 43 | public Long getQuantidadeVagas() { |
||
| 44 | return quantidadeVagas; |
||
| 45 | } |
||
| 46 | |||
| 47 | public String getDescricaoQuantidadeVagas() { |
||
| 48 | return VerificadorUtil.naoEstaNulo(quantidadeVagas) ? quantidadeVagas.toString() : NAO_SE_APLICA; |
||
| 49 | } |
||
| 50 | |||
| 51 | public void setQuantidadeVagas(Long quantidadeVagas) { |
||
| 52 | this.quantidadeVagas = quantidadeVagas; |
||
| 53 | } |
||
| 54 | |||
| 55 | public Long getQuantidadeVagasOcupadas() { |
||
| 56 | return quantidadeVagasOcupadas; |
||
| 57 | } |
||
| 58 | |||
| 59 | public void setQuantidadeVagasOcupadas(Long quantidadeVagasOcupadas) { |
||
| 60 | this.quantidadeVagasOcupadas = quantidadeVagasOcupadas; |
||
| 61 | } |
||
| 62 | |||
| 63 | public Long getSaldoVagas() { |
||
| 64 | return VerificadorUtil.naoEstaNulo(quantidadeVagas) ? quantidadeVagas-quantidadeVagasOcupadas : -quantidadeVagasOcupadas; |
||
| 65 | } |
||
| 66 | |||
| 67 | public String getDescricaoSaldoVagas() { |
||
| 68 | return VerificadorUtil.naoEstaNulo(quantidadeVagas) ? (new Long(quantidadeVagas-quantidadeVagasOcupadas)).toString() : NAO_SE_APLICA; |
||
| 69 | } |
||
| 70 | |||
| 71 | @Override |
||
| 72 | public int hashCode() { |
||
| 73 | final int prime = 31; |
||
| 74 | int result = 1; |
||
| 75 | result = prime * result + ((codigo == null) ? 0 : codigo.hashCode()); |
||
| 76 | return result; |
||
| 77 | } |
||
| 78 | |||
| 79 | @Override |
||
| 80 | public boolean equals(Object obj) { |
||
| 81 | if (this == obj) |
||
| 82 | return true; |
||
| 83 | if (obj == null) |
||
| 84 | return false; |
||
| 85 | if (getClass() != obj.getClass()) |
||
| 86 | return false; |
||
| 87 | CargoDTO other = (CargoDTO) obj; |
||
| 88 | if (codigo == null) { |
||
| 89 | if (other.codigo != null) |
||
| 90 | return false; |
||
| 91 | } else if (!codigo.equals(other.codigo)) |
||
| 92 | return false; |
||
| 93 | return true; |
||
| 94 | } |
||
| 95 | |||
| 96 | } |