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
| package com.qianwen.smartman.modules.andon.enums;
|
| import java.util.Arrays;
| import com.qianwen.core.tool.utils.Func;
|
| public enum DateType {
| DAY(1),
| WEEK(2),
| MONTH(3);
|
| private final Integer type;
|
| DateType(final Integer type) {
| this.type = type;
| }
|
| public Integer getType() {
| return this.type;
| }
|
| public static DateType findByType(Integer type) {
| if (Func.isNull(type)) {
| return DAY;
| }
| return (DateType) Arrays.stream(values()).filter(dt -> {
| return dt.getType().equals(type);
| }).findFirst().get();
| }
| }
|
|