All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum Maven / Gradle / Ivy

There is a newer version: 4.00.34
Show newest version
package br.com.swconsultoria.nfe.dom.enuns;

/**
 * @author Samuel Oliveira - [email protected]
 * Data: 02/03/2019 - 19:55
 */
public enum  DocumentoEnum {

    NFE("NFe", "55"),
    NFCE("NFCe", "65");

    private final String tipo;
    private final String modelo;

    DocumentoEnum(String tipo, String modelo) {
        this.tipo = tipo;
        this.modelo = modelo;
    }

    public String getTipo() {
        return tipo;
    }
    public String getModelo() {
        return modelo;
    }

    public static DocumentoEnum getByTipo(String tipo) {
        for (DocumentoEnum e : values()) {
            if (e.tipo.equals(tipo)) return e;
        }
        throw new IllegalArgumentException();
    }

    public static DocumentoEnum getByModelo(String modelo) {
        for (DocumentoEnum e : values()) {
            if (e.modelo.equals(modelo)) return e;
        }
        throw new IllegalArgumentException();
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy