Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 695 | blopes | 1 | package br.com.swconsultoria.nfe.dom.enuns; |
| 2 | |||
| 3 | /** |
||
| 4 | * @author Samuel Oliveira - samuk.exe@hotmail.com |
||
| 5 | * Data: 02/03/2019 - 19:55 |
||
| 6 | */ |
||
| 7 | public enum DocumentoEnum { |
||
| 8 | |||
| 9 | NFE("NFe", "55"), |
||
| 10 | NFCE("NFCe", "65"); |
||
| 11 | |||
| 12 | private final String tipo; |
||
| 13 | private final String modelo; |
||
| 14 | |||
| 15 | DocumentoEnum(String tipo, String modelo) { |
||
| 16 | this.tipo = tipo; |
||
| 17 | this.modelo = modelo; |
||
| 18 | } |
||
| 19 | |||
| 20 | public String getTipo() { |
||
| 21 | return tipo; |
||
| 22 | } |
||
| 23 | public String getModelo() { |
||
| 24 | return modelo; |
||
| 25 | } |
||
| 26 | |||
| 27 | public static DocumentoEnum getByTipo(String tipo) { |
||
| 28 | for (DocumentoEnum e : values()) { |
||
| 29 | if (e.tipo.equals(tipo)) return e; |
||
| 30 | } |
||
| 31 | throw new IllegalArgumentException(); |
||
| 32 | } |
||
| 33 | |||
| 34 | public static DocumentoEnum getByModelo(String modelo) { |
||
| 35 | for (DocumentoEnum e : values()) { |
||
| 36 | if (e.modelo.equals(modelo)) return e; |
||
| 37 | } |
||
| 38 | throw new IllegalArgumentException(); |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | } |