Files
powerjob-kingbase/powerjob-common/src/main/java/tech/powerjob/common/enums/SwitchableStatus.java
2025-09-19 16:14:08 +08:00

39 lines
732 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package tech.powerjob.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 支持开/关的状态,如 任务状态JobStatus和工作流状态WorkflowStatus
*
* @author tjq
* @since 2020/4/6
*/
@Getter
@AllArgsConstructor
public enum SwitchableStatus {
/**
* 启用
*/
ENABLE(1),
/**
* 关闭
*/
DISABLE(2),
/**
* 软删除
*/
DELETED(99);
private final int v;
public static SwitchableStatus of(int v) {
for (SwitchableStatus type : values()) {
if (type.v == v) {
return type;
}
}
throw new IllegalArgumentException("unknown SwitchableStatus of " + v);
}
}