Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.gov.al.saude.scs.tipo; |
| 2 | |||
| 3 | import br.gov.al.saude.framework.core.generic.TipoEnum; |
||
| 4 | |||
| 5 | public enum TipoFormaPresenca implements TipoEnum { |
||
| 6 | PRESENCIAL_INTERNO("I", "Presencial Interno"), |
||
| 7 | PRESENCIAL_EXTERNO("E", "Presencial Externo"), |
||
| 8 | A_DISTANCIA("D", "A Distância"); |
||
| 9 | |||
| 10 | private final String value; |
||
| 11 | private String descricao; |
||
| 12 | |||
| 13 | private TipoFormaPresenca(String value, String descricao) { |
||
| 14 | this.value = value; |
||
| 15 | this.descricao = descricao; |
||
| 16 | } |
||
| 17 | |||
| 18 | @Override |
||
| 19 | public String getValue() { |
||
| 20 | return value; |
||
| 21 | } |
||
| 22 | |||
| 23 | public String getDescricao() { |
||
| 24 | return descricao; |
||
| 25 | } |
||
| 26 | |||
| 27 | @Override |
||
| 28 | public String toString() { |
||
| 29 | return this.getDescricao(); |
||
| 30 | } |
||
| 31 | |||
| 32 | public static TipoFormaPresenca parse(String tipo) { |
||
| 33 | for (TipoFormaPresenca item : TipoFormaPresenca.values()) { |
||
| 34 | if (item.getValue().equals(tipo)) { |
||
| 35 | return item; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | return null; |
||
| 39 | } |
||
| 40 | |||
| 41 | } |