Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 795 | blopes | 1 | package br.com.kronus.core; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | public class Ativo implements Serializable { |
||
| 6 | |||
| 7 | private static final long serialVersionUID = 1L; |
||
| 8 | |||
| 9 | private Long sequencial; |
||
| 10 | private String nome; |
||
| 11 | private String tipoTendencia; |
||
| 12 | private Boolean ativo; |
||
| 13 | |||
| 14 | public Ativo() {} |
||
| 15 | |||
| 16 | public Ativo(Long sequencial, String nome) { |
||
| 17 | this.sequencial = sequencial; |
||
| 18 | this.nome = nome; |
||
| 19 | } |
||
| 20 | |||
| 21 | public Long getSequencial() { |
||
| 22 | return sequencial; |
||
| 23 | } |
||
| 24 | public void setSequencial(Long sequencial) { |
||
| 25 | this.sequencial = sequencial; |
||
| 26 | } |
||
| 27 | |||
| 28 | public String getNome() { |
||
| 29 | return nome; |
||
| 30 | } |
||
| 31 | public void setNome(String nome) { |
||
| 32 | this.nome = StringUtil.setarUpperCaseComTrim(nome); |
||
| 33 | } |
||
| 34 | |||
| 35 | public String getTipoTendencia() { |
||
| 36 | return tipoTendencia; |
||
| 37 | } |
||
| 38 | public void setTipoTendencia(String tipoTendencia) { |
||
| 39 | this.tipoTendencia = tipoTendencia; |
||
| 40 | } |
||
| 41 | |||
| 42 | public String getDescricaoDaTendencia() { |
||
| 43 | return VerificadorUtil.naoEstaNulo(getTipoTendencia())? TipoTendencia.parse(getTipoTendencia()).getDescricao() : ""; |
||
| 44 | } |
||
| 45 | |||
| 46 | public Boolean getAtivo() { |
||
| 47 | return ativo; |
||
| 48 | } |
||
| 49 | public void setAtivo(Boolean ativo) { |
||
| 50 | this.ativo = ativo; |
||
| 51 | } |
||
| 52 | |||
| 53 | @Override |
||
| 54 | public int hashCode() { |
||
| 55 | final int prime = 31; |
||
| 56 | int result = 1; |
||
| 57 | result = prime * result |
||
| 58 | + ((sequencial == null) ? 0 : sequencial.hashCode()); |
||
| 59 | return result; |
||
| 60 | } |
||
| 61 | |||
| 62 | @Override |
||
| 63 | public boolean equals(Object obj) { |
||
| 64 | if (this == obj) |
||
| 65 | return true; |
||
| 66 | if (obj == null) |
||
| 67 | return false; |
||
| 68 | if (getClass() != obj.getClass()) |
||
| 69 | return false; |
||
| 70 | Ativo other = (Ativo) obj; |
||
| 71 | if (sequencial == null) { |
||
| 72 | if (other.sequencial != null) |
||
| 73 | return false; |
||
| 74 | } else if (!sequencial.equals(other.sequencial)) |
||
| 75 | return false; |
||
| 76 | return true; |
||
| 77 | } |
||
| 78 | |||
| 79 | } |