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

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

import java.util.Arrays;

public enum DeleteStatusEnum implements IntArrayValuable {
    ENABLE(0, "启用"),
    DISABLE(1, "停用");
    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DeleteStatusEnum::getStatus).toArray();
    private final Integer status;
    private final String name;

    @Override
    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);
    }

    public Integer getStatus() {
        return this.status;
    }

    public String getName() {
        return this.name;
    }

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