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

import lombok.Getter;
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 {
    /** 计算规则种类,1-根据关系链计算关系 */
    REL_CHAIN("1","relChainCalculateServiceImpl"),
    /** 计算规则种类,2-根据坐标包含计算关系 */
    COORDINATE("2","coordinateCalculateServiceImpl"),
    /** 计算规则种类,3-根据继承关系计算关系 */
    REL_EXTEND("3","relExtendCalculateServiceImpl"),
    /** 计算规则种类,4-根据模型文件是否一样计算关系 */
    FL_THROUGH_FL("4","flThroughFlRelCalculateServiceImpl"),
    /** 计算规则种类,5-根据下级空间是否连通计算关系 */
    SH_THROUGH_SH("5","shThroughShRelCalculateServiceImpl"),
    /** 计算规则种类,6-根据门,窗,虚拟墙,元空间是否连通计算关系 */
    SPACE_CONNECTION("6","spaceConnectionRelCalculateServiceImpl");

    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));
    }

}
