package com.rjconsultores.ventaboletos.enums;

public enum IndStatusBoleto {

	V("VENDIDO", "V"),
	C("CANCELADO", "C"),
	T("TRANSFERIDO", "T"),
	E("ENTREGUE", "E"),
	S("RESERVADO", "S"),
	X("EXTRAVIADO", "X"),
	R("REIMPRESSO", "R"),
	M("MARCADO", "M");

	private String value;
	private String shortValue;

	private IndStatusBoleto(String value, String shortValue) {
		this.value = value;
		this.shortValue = shortValue;
	}

	public String getValue() {
		return value;
	}

	public String getShortValue() {
		return shortValue;
	}
	
	public static IndStatusBoleto getIndStatusBoleto(String shortValue) {
		if(V.getShortValue().equals(shortValue)) {
			return V;
		} else if(C.getShortValue().equals(shortValue)) {
			return C;
		} else if(T.getShortValue().equals(shortValue)) {
			return T;
		} else if(E.getShortValue().equals(shortValue)) {
			return E;
		} else if(S.getShortValue().equals(shortValue)) {
			return S;
		} else if(X.getShortValue().equals(shortValue)) {
			return X;
		} else if(R.getShortValue().equals(shortValue)) {
			return R;
		} else if(M.getShortValue().equals(shortValue)) {
			return M;
		}
		
		return null;
	}
	
	public static String getDescricao(String shortValue) {
		if(V.getShortValue().equals(shortValue)) {
			return V.value;
		} else if(C.getShortValue().equals(shortValue)) {
			return C.value;
		} else if(T.getShortValue().equals(shortValue)) {
			return T.value;
		} else if(E.getShortValue().equals(shortValue)) {
			return E.value;
		} else if(S.getShortValue().equals(shortValue)) {
			return S.value;
		} else if(X.getShortValue().equals(shortValue)) {
			return X.value;
		} else if(R.getShortValue().equals(shortValue)) {
			return R.value;
		} else if(M.getShortValue().equals(shortValue)) {
			return M.value;
		}
		
		return null;
	}

}