package com.qianwen.smartman.common.enums; import java.util.Arrays; import java.util.List; /** * 菜单分类 */ public enum MenuCategoryEnum { APP(0, "app"), MENU(1, "菜单"), BUTTON(2, "按钮"), CARD(3, "卡片"); private final int status; private final String desc; MenuCategoryEnum(final int status, final String desc) { this.status = status; this.desc = desc; } public int getStatus() { return this.status; } public String getDesc() { return this.desc; } public static MenuCategoryEnum of(Integer status) { if (status == null) { return null; } MenuCategoryEnum[] values = values(); for (MenuCategoryEnum menuCategoryEnum : values) { if (menuCategoryEnum.status == status.intValue()) { return menuCategoryEnum; } } return null; } public static List getMenusOutofCard() { return Arrays.asList(APP.getStatus(), MENU.getStatus(), BUTTON.getStatus()); } public static List getMenusWithCard() { return Arrays.asList(APP.getStatus(), CARD.getStatus()); } public static List getMenus() { return Arrays.asList(APP.getStatus(), MENU.getStatus()); } }