package com.tofly.base.em;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 是否进入工地管理
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsHandlerEnum {
    /**
     *
     */
    IS_HANDLER_PENDING("0","待完成"),
    IS_HANDLER_COMPLETED("1","已完成 "),
    IS_HANDLER_NOT_STARTED("2","未开始"),
    IS_HANDLER_TIMEOUT("3","已超时"),
    IS_HANDLER_TIMEOUT_EXPIRED("4","已超时待完成")

    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

        for (IsHandlerEnum e : IsHandlerEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
