package com.persagy.dmp.rwd.basic.constant;

import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.EnumUtil;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.EnumUtils;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/***
 * Description: 计算规则种类
 * @author : lijie
 * @date :2021/9/8 10:48
 * Update By lijie 2021/9/8 10:48
 */
@Getter
public enum CalRuleTypeEnum {

    REL_CHAIN("1","relChainCalculateService"),
    COORDINATE("2","coordinateCalculateService");

    CalRuleTypeEnum(String index, String beanName) {
        this.index = index;
        this.beanName = beanName;
    }

    private String index;
    private String beanName;

    public static Map<String,String> getCalRuleTypeMap(){
        List<CalRuleTypeEnum> enumList = EnumUtils.getEnumList(CalRuleTypeEnum.class);
        return enumList.stream().collect(Collectors.toMap(CalRuleTypeEnum::getIndex,CalRuleTypeEnum::getBeanName));
    }

}
