package com.fs.hisStore.enums;

import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * 设置不转码的项目
 */
public enum LiveEnum {
    KANGNIAN_TANG("康年堂"),
    SIFU_TANG("四福堂"),
    NMG_MYT("内蒙古一贴"),
    CQ_TYT("重庆泰医堂"),
    HDT("弘德堂"),
    JNMY("金牛明医"),
    HYT("鹤颜堂"),
    Z_K("中康");

    private final String companyName;

    LiveEnum(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyName() {
        return companyName;
    }

    /**
     * 静态集合，避免每次调用都重新创建
     */
    private static final Set<String> COMPANY_NAMES = Collections.unmodifiableSet(
            Arrays.stream(values())
                    .map(LiveEnum::getCompanyName)
                    .collect(Collectors.toSet())
    );

    /**
     * 比较是否存在
     *
     * @param companyName
     * @return
     */
    public static boolean contains(String companyName) {
        return COMPANY_NAMES.contains(companyName);
    }
}
