Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 778 | blopes | 1 | package br.com.sl.domain.model.tipos; |
| 2 | |||
| 3 | public enum TipoTendencia { |
||
| 4 | |||
| 5 | ALTA_A("A", "ALTA"), |
||
| 6 | BAIXA_B("B", "BAIXA"), |
||
| 7 | NAO_DEFINIDA_N("N", "NÃO DEFINIDA"); |
||
| 8 | |||
| 9 | private String tipo; |
||
| 10 | private String descricao; |
||
| 11 | |||
| 12 | private TipoTendencia(String tipo, String descricao) { |
||
| 13 | this.tipo = tipo; |
||
| 14 | this.descricao = descricao; |
||
| 15 | } |
||
| 16 | |||
| 17 | public String getDescricao() { |
||
| 18 | return descricao; |
||
| 19 | } |
||
| 20 | |||
| 21 | public String getValor() { |
||
| 22 | return tipo; |
||
| 23 | } |
||
| 24 | |||
| 25 | public static TipoTendencia parse(String tipo) { |
||
| 26 | for (TipoTendencia item : TipoTendencia.values()) { |
||
| 27 | if (item.getValor().equals(tipo)) { |
||
| 28 | return item; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | return null; |
||
| 32 | } |
||
| 33 | |||
| 34 | } |