潘志宝
2024-11-28 231897591c909b164defebfdb5936387ec2807d0
提交 | 用户 | 时间
149dd0 1 package com.iailab.netsdk.lib.enumeration;
H 2
3 /**
4  * @author : 291189
5  * @since : Created in 2021/6/30 11:01
6  *  人脸表情
7  */
8
9 public enum  EM_SECURITYGATE_EXPRESSION_TYPE {
10     EM_SECURITYGATE_EXPRESSION_UNKNOWN(-1,"未知"),                // 未知
11     EM_SECURITYGATE_EXPRESSION_UNDEFINE(0,"未识别"),                    // 未识别
12     EM_SECURITYGATE_EXPRESSION_ANGER(1,"生气"),                        // 生气
13     EM_SECURITYGATE_EXPRESSION_SAD(2,"悲伤"),                            // 悲伤
14     EM_SECURITYGATE_EXPRESSION_DISGUST(3,"厌恶"),                        // 厌恶
15     EM_SECURITYGATE_EXPRESSION_FEAR(4,"恐惧"),                        // 恐惧
16     EM_SECURITYGATE_EXPRESSION_SURPRISED(5,"诧异"),                    // 诧异
17     EM_SECURITYGATE_EXPRESSION_CALM(6,"平静"),                        // 平静
18     EM_SECURITYGATE_EXPRESSION_SMILE(7,"微笑"),                        // 微笑
19     EM_SECURITYGATE_EXPRESSION_LAUGH(8,"大笑"),                        // 大笑
20     EM_SECURITYGATE_EXPRESSION_HAPPY(9,"高兴"),                        // 高兴
21     EM_SECURITYGATE_EXPRESSION_CONFUSE(10,"困惑"),                        // 困惑
22     EM_SECURITYGATE_EXPRESSION_SCREAM(11,"尖叫");                        // 尖叫
23
24     private final int value;
25     private final String note;
26
27     EM_SECURITYGATE_EXPRESSION_TYPE(int givenValue, String note) {
28         this.value = givenValue;
29         this.note = note;
30     }
31
32     public String getNote() {
33         return note;
34     }
35
36     public int getValue() {
37         return value;
38     }
39
40     public static String getNoteByValue(int givenValue) {
41         for (EM_SECURITYGATE_EXPRESSION_TYPE enumType : EM_SECURITYGATE_EXPRESSION_TYPE.values()) {
42             if (givenValue == enumType.getValue()) {
43                 return enumType.getNote();
44             }
45         }
46         return null;
47     }
48
49     public static int getValueByNote(String givenNote) {
50         for (EM_SECURITYGATE_EXPRESSION_TYPE enumType : EM_SECURITYGATE_EXPRESSION_TYPE.values()) {
51             if (givenNote.equals(enumType.getNote())) {
52                 return enumType.getValue();
53             }
54         }
55         return -1;
56     }
57
58     public static EM_SECURITYGATE_EXPRESSION_TYPE getEnum(int value) {
59         for (EM_SECURITYGATE_EXPRESSION_TYPE e : EM_SECURITYGATE_EXPRESSION_TYPE.values()) {
60             if (e.getValue() == value)
61                 return e;
62         }
63         return EM_SECURITYGATE_EXPRESSION_TYPE.EM_SECURITYGATE_EXPRESSION_UNKNOWN;
64     }
65 }