package com.ai.da.common.enums;

import java.util.stream.Stream;

/**
 * @author yanglei
 * @description design类型 用户design生成时候区别library和collection
 * @create 2022-11-8 17:33
 **/
public enum DesignTypeEnum {
    /**
     * Collection
     */
    COLLECTION("Collection"),
    /**
     * Library
     */
    LIBRARY("Library"),
    GENERATE("Generate");

    private String realName;

    DesignTypeEnum(String realName) {
        this.realName = realName;
    }

    public String getRealName() {
        return realName;
    }

    public static DesignTypeEnum of(String realName) {
        return Stream.of(DesignTypeEnum.values()).filter(v -> v.getRealName().equals(realName)).findFirst().orElse(null);
    }
}
