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

com.nxyfan.framework.common.enums.CommonUserStatusEnum Maven / Gradle / Ivy

package com.nxyfan.framework.common.enums;

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

/** 
 *
 * Describe: 通用用户状态枚举
 * Author: amour  
 * Create Time: 2022年11月22日 上午10:41:44 
 * Copyright @ 2022 51LIFE  
 */
@Getter
public enum CommonUserStatusEnum {

	/**
     * 正常
     */
    ENABLE("Y"),

    /**
     * 停用
     */
    DISABLED("N");

    private final String value;

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

    public static void validate(String value) {
        boolean flag = ENABLE.getValue().equals(value) || DISABLED.getValue().equals(value);
        if(!flag) {
            throw new CommonException("不支持的用户状态:{}", value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy