package com.mx.dla.dda.contrato.generales.enums;

public enum AreasOrden {

	Aprovisionamiento(1, 1), Legal(2, 2), Finanzas(3, 3), Programacion(4, 4), Direccion(
			5, 5);

	private Integer id;
	private Integer orden;

	AreasOrden(Integer id, Integer orden) {
		this.id = id;
		this.orden = orden;
	}

	public Integer getId() {
		return id;
	}

	public Integer getOrden() {
		return orden;
	}

	public static AreasOrden parseById(Integer id) {
		AreasOrden[] values = AreasOrden.values();
		AreasOrden target = null;
		for (AreasOrden t : values) {
			if (t.getId().equals(id)) {
				target = t;
				break;
			}
		}
		return target;

	}
	
	
	public static AreasOrden parseByOrden(Integer orden) {
		AreasOrden[] values = AreasOrden.values();
		AreasOrden target = null;
		for (AreasOrden t : values) {
			if (t.getOrden().equals(orden)) {
				target = t;
				break;
			}
		}
		return target;

	}
}
