package com.quantgroup.asset.distribution.service.newrule.pojo.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shihuajun
 * @date 2021/8/27 14:33
 * @ describing
 */
@Getter
public enum CooperationEnum {
    /**
     * 助贷
     */
    DIVERSION,
    /**
     * 导流
     */
    ASSISTANCE;

    public static CooperationEnum parse(String name){
        if (StringUtils.isBlank(name)){
            throw new RuntimeException("解析CooperationEnum入参为空");
        }
        for (CooperationEnum cooperation : CooperationEnum.values()) {
            if (name.equals(cooperation.name())){
                return cooperation;
            }
        }
        throw new RuntimeException("解析CooperationEnum出问题了");
    }
}
