Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | espaco | 1 | package br.com.ec.domain.model.tipos; |
| 2 | |||
| 3 | public enum TipoStatusPedidoCompra { |
||
| 4 | |||
| 5 | PENDENTE("P", "PENDENTE", "orange-btn", "#efa64c"), |
||
| 6 | VERIFICADO("V", "VERIFICADO", "green-btn", "#57c279"), |
||
| 7 | SOLICITADO("S", "SOLICITADO", "blue-btn", "#2f8ee5"), |
||
| 8 | SEM_ESTOQUE("E", "SEM ESTOQUE", "deep-purple-btn", "#7e57c2"), |
||
| 9 | NAO_COMPRAR("N", "NÃO COMPRAR", "pink-btn", "#f16383"); |
||
| 10 | |||
| 11 | private String tipo; |
||
| 12 | private String descricao; |
||
| 13 | private String styleBotao; |
||
| 14 | private String cor; |
||
| 15 | |||
| 16 | private TipoStatusPedidoCompra(String tipo, String descricao, String styleBotao, String cor) { |
||
| 17 | this.tipo = tipo; |
||
| 18 | this.descricao = descricao; |
||
| 19 | this.styleBotao = styleBotao; |
||
| 20 | this.cor = cor; |
||
| 21 | } |
||
| 22 | |||
| 23 | public String getDescricao() { |
||
| 24 | return descricao; |
||
| 25 | } |
||
| 26 | |||
| 27 | public String getValor() { |
||
| 28 | return tipo; |
||
| 29 | } |
||
| 30 | |||
| 31 | public String getStyleBotao() { |
||
| 32 | return styleBotao; |
||
| 33 | } |
||
| 34 | |||
| 35 | public String getCor() { |
||
| 36 | return cor; |
||
| 37 | } |
||
| 38 | |||
| 39 | public static TipoStatusPedidoCompra parse(String tipo) { |
||
| 40 | for (TipoStatusPedidoCompra item : TipoStatusPedidoCompra.values()) { |
||
| 41 | if (item.getValor().equals(tipo)) { |
||
| 42 | return item; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | return null; |
||
| 46 | } |
||
| 47 | |||
| 48 | } |