# GmwrHotelKpiCategoryEnum.java

    package cloud.wconnect.workperformance.cons.gmwr;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * Enum: Hotel KPI Category
     *
     * @author zc
     * @date 2024/12/30
     */
    @Getter
    @AllArgsConstructor
    public enum GmwrHotelKpiCategoryEnum {

        REVENUE(1, "REVENUE"),
        EXPENSE(2, "EXPENSE"),
        QUALITY_SERVICE(3, "QUALITY & SERVICE");

        private final int category;

        private final String title;

        /**
         * 获取标题
         *
         * @param category 分类
         * @return java.lang.String
         * @author zc
         * @date 2024/12/30
         */
        public static String getTitle(int category) {
            Optional<GmwrHotelKpiCategoryEnum> optional = Arrays.stream(GmwrHotelKpiCategoryEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getTitle() : "";
        }

    }