package com.ai.da.common.enums;

import java.util.stream.Stream;

/**
 * @author yanglei
 * @description 控制生成类型的参数枚举：outfit时候传 single , 另外一个传 overall
 * @create 2022-10-3 17:33
 **/
public enum SingleOverallEnum {
    /**
     * 单个
     */
    SINGLE("single"),
    /**
     * 所有
     */
    OVERALL("overall");

    private String realName;

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

    public String getRealName() {
        return realName;
    }

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