package org.springblade.flow.permission.enums;

/**
 * 用户关系枚举类
 * 
 * @author william
 * @date 2022年8月1日 上午11:32:13
 */
public enum UserRelationEnum {
	Position(0, "Position"), //
	Role(1, "Role");

	private Integer value;
	private String name;

	private UserRelationEnum(Integer value, String name) {
		this.value = value;
		this.name = name;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static UserRelationEnum reslove(Integer value) {
		UserRelationEnum[] values = UserRelationEnum.values();
		for (UserRelationEnum val : values) {
			if (value != null && val.getValue().intValue() == value) {
				return val;
			}
		}
		return null;
	}
}
