Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
package br.gov.al.saude.srv.model.enums;
2
 
3
import br.gov.al.saude.framework.core.generic.TipoEnum;
4
 
5
public enum TipoNivel implements TipoEnum{
6
 
7
        ELEMENTAR("E", "Elementar"),
8
        MEDIO("M", "Médio"),
9
        SUPERIOR("S", "Superior");
10
 
11
        private final String value;
12
        private String descricao;
13
 
14
        private TipoNivel(String value, String descricao) {
15
                this.value = value;
16
                this.descricao = descricao;
17
        }
18
 
19
        public String getValue() {
20
                return this.value;
21
        }
22
 
23
        public String getDescricao() {
24
                return this.descricao;
25
        }
26
 
27
        public static TipoNivel parse(String tipo) {
28
                for (TipoNivel item : TipoNivel.values()) {
29
                        if (item.getValue().equals(tipo)) {
30
                                return item;
31
                        }
32
                }
33
                return null;
34
        }
35
 
36
        @Override
37
        public String toString() {
38
                return this.getDescricao();
39
        }
40
}