forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalNodeState.java
More file actions
53 lines (41 loc) · 1.18 KB
/
Copy pathLocalNodeState.java
File metadata and controls
53 lines (41 loc) · 1.18 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.Map;
/**
* https://github.com/moby/moby/blob/master/api/types/swarm/swarm.go#L174-L188
*
* @since 1.24
*/
public enum LocalNodeState {
INACTIVE("inactive"),
PENDING("pending"),
ACTIVE("active"),
ERROR("error"),
LOCKED("locked"),
/**
* Can not construct instance of com.github.dockerjava.api.model.LocalNodeState
* from String value '': value not one of declared Enum instance names: [error, locked, inactive, active, pending]
*/
EMPTY("");
private static final Map<String, LocalNodeState> TYPES = new HashMap<>();
static {
for (LocalNodeState t : values()) {
TYPES.put(t.name().toLowerCase(), t);
}
}
private String value;
LocalNodeState(@Nonnull String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@JsonCreator
public static LocalNodeState forValue(String s) {
return TYPES.get(s);
}
}