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;
8 import java.util.Objects;
9 import java.util.Optional;
10 import org.opendaylight.yangtools.yang.binding.Enumeration;
12 public enum TxDirection implements Enumeration {
17 DLAndUL(2, "DL and UL")
20 private static final Map<String, TxDirection> NAME_MAP;
21 private static final Map<Integer, TxDirection> VALUE_MAP;
24 final Builder<String, TxDirection> nb = ImmutableMap.builder();
25 final Builder<Integer, TxDirection> vb = ImmutableMap.builder();
26 for (TxDirection enumItem : TxDirection.values()) {
27 vb.put(enumItem.value, enumItem);
28 nb.put(enumItem.name, enumItem);
31 NAME_MAP = nb.build();
32 VALUE_MAP = vb.build();
35 private final String name;
36 private final int value;
38 private TxDirection(int value, String name) {
44 public String getName() {
49 public int getIntValue() {
54 * Return the enumeration member whose {@link #getName()} matches specified value.
56 * @param name YANG assigned name
57 * @return corresponding TxDirection item, if present
58 * @throws NullPointerException if name is null
60 public static Optional<TxDirection> forName(String name) {
61 return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name)));
65 * Return the enumeration member whose {@link #getIntValue()} matches specified value.
67 * @param intValue integer value
68 * @return corresponding TxDirection item, or null if no such item exists
70 public static TxDirection forValue(int intValue) {
71 return VALUE_MAP.get(intValue);