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 / TCellState.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 TCellState implements Enumeration {
13     /**
14      * The resource is not currently in use.
15      *
16      */
17     Idle(0, "Idle"),
18     
19     /**
20      * The resource is not available for use.
21      *
22      */
23     Inactive(1, "Inactive"),
24     
25     /**
26      * The resource is in use.
27      *
28      */
29     Active(2, "Active")
30     ;
31
32     private static final Map<String, TCellState> NAME_MAP;
33     private static final Map<Integer, TCellState> VALUE_MAP;
34
35     static {
36         final Builder<String, TCellState> nb = ImmutableMap.builder();
37         final Builder<Integer, TCellState> vb = ImmutableMap.builder();
38         for (TCellState enumItem : TCellState.values()) {
39             vb.put(enumItem.value, enumItem);
40             nb.put(enumItem.name, enumItem);
41         }
42
43         NAME_MAP = nb.build();
44         VALUE_MAP = vb.build();
45     }
46
47     private final String name;
48     private final int value;
49
50     private TCellState(int value, String name) {
51         this.value = value;
52         this.name = name;
53     }
54
55     @Override
56     public String getName() {
57         return name;
58     }
59
60     @Override
61     public int getIntValue() {
62         return value;
63     }
64
65     /**
66      * Return the enumeration member whose {@link #getName()} matches specified value.
67      *
68      * @param name YANG assigned name
69      * @return corresponding TCellState item, if present
70      * @throws NullPointerException if name is null
71      */
72     public static Optional<TCellState> forName(String name) {
73         return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name)));
74     }
75
76     /**
77      * Return the enumeration member whose {@link #getIntValue()} matches specified value.
78      *
79      * @param intValue integer value
80      * @return corresponding TCellState item, or null if no such item exists
81      */
82     public static TCellState forValue(int intValue) {
83         return VALUE_MAP.get(intValue);
84     }
85 }