package com.smppw.common.pojo.enums;

import java.util.stream.Stream;

/**
 * @author zhengsongliang
 * @datetime 2017年8月7日 下午4:41:43
 */
public enum Constraint {
	LongPosition(1), ShortPosition(2);
	private int id;

	public int getId() {
		return id;
	}

	private Constraint(int id) {
		this.id = id;
	}

	public static Constraint getConstraint(int id) {
		return Stream.of(Constraint.values()).filter(e -> e.id == id).findFirst().orElse(null);
	}
}
