liusuyi
2025-03-20 8773c724919714845d4426a54d7b5aab8a9c0cae
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.ard.tianyu.domain.message;
 
import lombok.Getter;
 
/**
 * 控制权类型枚举
 *
 * @author liusuyi
 * @date 2024年11月04日14:40
 **/
@Getter
public enum UavControlType {
    FLY("fly"), PAYLOAD("payload");
 
    private final String type;
 
    UavControlType(String type) {
        this.type = type;
    }
 
    public static UavControlType fromString(String type) {
        for (UavControlType value : UavControlType.values()) {
            if (value.getType().equalsIgnoreCase(type)) {
                return value;
            }
        }
        throw new IllegalArgumentException("未知的控制类型: " + type);
    }
}