Create VES client example for domain 'notification'
[oam.git] / features / devicemanager / g-ran / ru-fh / provider / src / main / java / org / opendaylight / yang / gen / v1 / urn / _3gpp / tsg / sa5 / nrm / types / rev180731 / TOperationalState.java
1 package org.opendaylight.yang.gen.v1.urn._3gpp.tsg.sa5.nrm.types.rev180731;
2 import com.google.common.collect.ImmutableMap;
3 import com.google.common.collect.ImmutableMap.Builder;
4 import java.lang.Integer;
5 import java.lang.Override;
6 import java.lang.String;
7 import java.util.Map;
8 import java.util.Objects;
9 import java.util.Optional;
10 import org.opendaylight.yangtools.yang.binding.Enumeration;
11
12 public enum TOperationalState implements Enumeration {
13     /**
14      * The resource is partially or fully operable and available for use.
15      *
16      */
17     Enabled(0, "Enabled"),
18     
19     /**
20      * The resource is totally inoperable and unable to provide serviceto the user(s).
21      *
22      */
23     Disabled(1, "Disabled")
24     ;
25
26     private static final Map<String, TOperationalState> NAME_MAP;
27     private static final Map<Integer, TOperationalState> VALUE_MAP;
28
29     static {
30         final Builder<String, TOperationalState> nb = ImmutableMap.builder();
31         final Builder<Integer, TOperationalState> vb = ImmutableMap.builder();
32         for (TOperationalState enumItem : TOperationalState.values()) {
33             vb.put(enumItem.value, enumItem);
34             nb.put(enumItem.name, enumItem);
35         }
36
37         NAME_MAP = nb.build();
38         VALUE_MAP = vb.build();
39     }
40
41     private final String name;
42     private final int value;
43
44     private TOperationalState(int value, String name) {
45         this.value = value;
46         this.name = name;
47     }
48
49     @Override
50     public String getName() {
51         return name;
52     }
53
54     @Override
55     public int getIntValue() {
56         return value;
57     }
58
59     /**
60      * Return the enumeration member whose {@link #getName()} matches specified value.
61      *
62      * @param name YANG assigned name
63      * @return corresponding TOperationalState item, if present
64      * @throws NullPointerException if name is null
65      */
66     public static Optional<TOperationalState> forName(String name) {
67         return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name)));
68     }
69
70     /**
71      * Return the enumeration member whose {@link #getIntValue()} matches specified value.
72      *
73      * @param intValue integer value
74      * @return corresponding TOperationalState item, or null if no such item exists
75      */
76     public static TOperationalState forValue(int intValue) {
77         return VALUE_MAP.get(intValue);
78     }
79 }