package com.ningdatech.pmapi.expert.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author liuxinxin
 * @date 2022/7/22 下午4:21
 */
@AllArgsConstructor
@Getter
public enum ExpertAccountStatusEnum {

    /**
     * 可用
     */
    AVAILABLE("available"),

    /**
     * 冻结中
     */
    FREEZE("freeze"),

    /**
     * 已出库
     */
    DELIVERY("delivery"),

    /**
     * 申请中
     */
    APPLYING("applying");

    private final String key;

    public static ExpertAccountStatusEnum of(String key) {
        for (ExpertAccountStatusEnum statusEnum : ExpertAccountStatusEnum.values()) {
            if (statusEnum.key.equals(key)) {
                return statusEnum;
            }
        }
        throw new IllegalArgumentException(String.format("Illegal ExpertAccountStatusEnum = %s", key));
    }
}
