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