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
| package com.ard.work.domain.enums;
|
| public enum MessageType {
| HEARTBEAT("heartbeat"),
| STREAM("stream"),
| STATE("state"),
| TELEMETRY("telemetry"),
| SIGNAL("signal"),
| CONTROLLER("controller"),
| NO_FLY_DISTANCE("noFlyDistance"),
| ALL("all");
|
| private final String type;
|
| MessageType(String type) {
| this.type = type;
| }
|
| public String getType() {
| return type;
| }
|
| public static MessageType fromString(String type) {
| for (MessageType messageType : MessageType.values()) {
| if (messageType.type.equalsIgnoreCase(type)) {
| return messageType;
| }
| }
| throw new IllegalArgumentException("Unknown message type: " + type);
| }
| }
|
|