33 lines
717 B
Java
33 lines
717 B
Java
package com.rjconsultores.ventaboletos.enums;
|
|
|
|
public enum EStatusContingencia {
|
|
|
|
NORMAL(1, "Normal"),
|
|
CONTINGENCIA(2, "Contingência");
|
|
|
|
private Integer id;
|
|
private String descricao;
|
|
|
|
private EStatusContingencia(Integer id, String descricao) {
|
|
this.id = id;
|
|
this.descricao = descricao;
|
|
}
|
|
|
|
public Integer getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getDescricao() {
|
|
return descricao;
|
|
}
|
|
|
|
public static EStatusContingencia getStatusContingencia(Integer id) {
|
|
for (EStatusContingencia status : EStatusContingencia.values()) {
|
|
if (status.getId().equals(id)) {
|
|
return status;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Status contigência não definido");
|
|
}
|
|
}
|