yangys
2024-03-30 871c0fce344b24c8046ec01173eca79b9e60c1d7
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.qianwen.smartman.modules.mdc.enums;
 
import java.util.stream.Stream;
 
public enum FeedbackDetailStatus {
    DELETE("作废", 2),
    WAIT_EFFECT("待生效", 0),
    EFFECTED("已生效", 1);
    
    private final String name;
    private final int value;
 
    FeedbackDetailStatus(String name, int value) {
        this.name = name;
        this.value = value;
    }
 
    public int getValue() {
        return this.value;
    }
 
    public String getName() {
        return this.name;
    }
 
    public FeedbackDetailStatus of(final Integer value) {
        if (value == null) {
            return null;
        }
        return Stream.<FeedbackDetailStatus>of(values()).filter(item -> (item.getValue() == value.intValue())).findFirst().orElse(null);
        /*
        return (FeedbackDetailStatus) Stream.of((Object[]) values()).filter(item -> {
            return item.getValue() == value.intValue();
        }).findFirst().orElse(null);*/
    }
}