1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| package com.fastbee.common.enums;
|
| import com.fastbee.common.core.text.IntArrayValuable;
| import lombok.AllArgsConstructor;
| import lombok.Getter;
|
| import java.util.Arrays;
|
| /**
| * 通用状态枚举
|
| */
| @Getter
| @AllArgsConstructor
| public enum CommonStatusEnum implements IntArrayValuable {
|
| ENABLE(0, "开启"),
| DISABLE(1, "关闭");
|
| public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray();
|
| /**
| * 状态值
| */
| private final Integer status;
| /**
| * 状态名
| */
| private final String name;
|
| @Override
| public int[] array() {
| return ARRAYS;
| }
|
| }
|
|