package com.sky.ioc.enums;

/**
 * 菜品类型枚举类  早餐，中餐，晚餐
 * */
public enum CuisineTypeEnums {

    CUISINE_TYPE_BREAKFAST("1", "早餐"),
    CUISINE_TYPE_LUNCH("2", "中餐"),
    CUISINE_TYPE_DINNER("3", "晚餐");

    private String type;

    private String desc;

    private CuisineTypeEnums(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getValue(String type) {
        CuisineTypeEnums[] CuisineTypeEnumss = values();
        for (CuisineTypeEnums CuisineTypeEnums : CuisineTypeEnumss) {
            if (CuisineTypeEnums.type().equals(type)) {
                return CuisineTypeEnums.desc();
            }
        }
        return null;
    }

    public static String getType(String desc) {
        CuisineTypeEnums[] CuisineTypeEnumss = values();
        for (CuisineTypeEnums CuisineTypeEnums : CuisineTypeEnumss) {
            if (CuisineTypeEnums.desc().equals(desc)) {
                return CuisineTypeEnums.type();
            }
        }
        return null;
    }

    private String type() {
        return this.type;
    }

    private String desc() {
        return this.desc;
    }
}
