# HotelKpiStrWeekEnum.java

    package cloud.wconnect.workperformance.cons.hotelkpi.strdata;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: STR Week
     *
     * @author zc
     * @date 2025/02/28
     */
    @Getter
    @AllArgsConstructor
    public enum HotelKpiStrWeekEnum {

        OCC_PERCENT(1, "OCC %"),
        ADR(2, "ADR"),
        REV_PAR(3, "REV PAR");

        private final int category;

        private final String categoryName;

        /**
         * 获取分类名称
         *
         * @param category 分类
         * @return java.lang.String
         * @author zc
         * @date 2025/2/28
         */
        public static String getCategoryName(int category) {
            Optional<HotelKpiStrWeekEnum> optional = Arrays.stream(HotelKpiStrWeekEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getCategoryName() : "";
        }

    }