package com.ejie.ad74a.util.constantes;

import java.util.Locale;

import org.springframework.context.i18n.LocaleContextHolder;

import com.ejie.ad74a.util.comun.Utilidades;

/**
 * Tipos de entrada
 */

public enum OrigenAvisosEnum {

	DSS("2", "avisos.combos.dss"), PS("3", "avisos.combos.ps"), SSB("4", "avisos.combos.ssb");

	private OrigenAvisosEnum(String id, String labelDesc) {
		this.labelDesc = labelDesc;
		this.id = id;
	}

	private String id;
	private String labelDesc;

	public String getId() {
		return this.id;
	}

	public String getLabelDesc() {
		return Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, this.labelDesc,
				LocaleContextHolder.getLocale());
	}

	public String getLabelDesc(Locale locale) {
		return Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, this.labelDesc, locale);
	}

	public static OrigenAvisosEnum getById(String id) {
		for (OrigenAvisosEnum e : values()) {
			if (e.id.equals(id))
				return e;
		}
		return null;
	}

}
