All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nxyfan.framework.task.enums.SysTaskStateEnum Maven / Gradle / Ivy

package com.nxyfan.framework.task.enums;

import com.nxyfan.framework.common.exception.CommonException;
import lombok.Getter;

/** 
 *
 * Describe: 定时任务状态枚举
 * Author: caoyang  
 * Create Time: 2022年12月5日 下午5:08:19 
 * Copyright @ 2022 51LIFE  
 */
@Getter
public enum SysTaskStateEnum {

	/**
     * 运行
     */
    RUNNING("RUNNING"),

    /**
     * 停止
     */
    STOPPED("STOPPED");

    private final String value;

    SysTaskStateEnum(String value) {
        this.value = value;
    }

    public static void validate(String value) {
        boolean flag = RUNNING.getValue().equals(value) || STOPPED.getValue().equals(value);
        if(!flag) {
            throw CommonException.bizException("不支持的定时任务状态:{}", value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy