package com.yc.ship.module.otc.enums;

import cn.hutool.core.util.ObjUtil;
import com.yc.ship.framework.common.core.IntArrayValuable;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum UseStatusEnum implements IntArrayValuable {
    ENABLE(1, "启用"),
    DISABLE(0, "禁用");
    private final Integer status;
    private final String name;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UseStatusEnum::getStatus).toArray();
    public int[] array() {
        return ARRAYS;
    }

    public static boolean isEnable(Integer status) {
        return ObjUtil.equal(ENABLE.status, status);
    }

    public static boolean isDisable(Integer status) {
        return ObjUtil.equal(DISABLE.status, status);
    }

    UseStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }
}
