# GmwrStrDataEnum.java

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

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

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

        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<GmwrStrDataEnum> optional = Arrays.stream(GmwrStrDataEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getCategoryName() : "";
        }

    }