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 / TSNSSAI.java
1 package org.opendaylight.yang.gen.v1.urn._3gpp.tsg.sa5.nrm.types.rev180731;
2 import com.google.common.base.MoreObjects;
3 import java.io.Serializable;
4 import java.lang.Long;
5 import java.lang.Override;
6 import java.lang.Short;
7 import java.lang.String;
8 import java.util.Objects;
9 import org.opendaylight.yangtools.yang.binding.CodeHelpers;
10 import org.opendaylight.yangtools.yang.binding.TypeObject;
11
12 public class TSNSSAI
13  implements TypeObject, Serializable {
14     private static final long serialVersionUID = -2943261658086489871L;
15     private final Short _uint8;
16     private final Long _uint32;
17
18
19     private static void checkUint8Range(final short value) {
20         if (value >= (short)0 && value <= (short)255) {
21             return;
22         }
23         CodeHelpers.throwInvalidRange("[[0..255]]", value);
24     }
25     public TSNSSAI(Short _uint8) {
26         super();
27         checkUint8Range(_uint8);
28         
29         this._uint8 = _uint8;
30         this._uint32 = null;
31     }
32     
33     private static void checkUint32Range(final long value) {
34         if (value >= 0L && value <= 4294967295L) {
35             return;
36         }
37         CodeHelpers.throwInvalidRange("[[0..4294967295]]", value);
38     }
39     public TSNSSAI(Long _uint32) {
40         super();
41         checkUint32Range(_uint32);
42         
43         this._uint32 = _uint32;
44         this._uint8 = null;
45     }
46     /**
47      * Creates a copy from Source Object.
48      *
49      * @param source Source object
50      */
51     public TSNSSAI(TSNSSAI source) {
52         this._uint8 = source._uint8;
53         this._uint32 = source._uint32;
54     }
55     
56     /**
57      * Return a String representing the value of this union.
58      *
59      * @return String representation of this union's value.
60      */
61     public String stringValue() {
62         if (_uint8 != null) {
63             return _uint8.toString();
64         }
65         if (_uint32 != null) {
66             return _uint32.toString();
67         }
68     
69         throw new IllegalStateException("No value assinged");
70     }
71
72
73     public Short getUint8() {
74         return _uint8;
75     }
76     
77     public Long getUint32() {
78         return _uint32;
79     }
80
81
82     @Override
83     public int hashCode() {
84         final int prime = 31;
85         int result = 1;
86         result = prime * result + Objects.hashCode(_uint8);
87         result = prime * result + Objects.hashCode(_uint32);
88         return result;
89     }
90
91     @Override
92     public boolean equals(java.lang.Object obj) {
93         if (this == obj) {
94             return true;
95         }
96         if (obj == null) {
97             return false;
98         }
99         if (getClass() != obj.getClass()) {
100             return false;
101         }
102         TSNSSAI other = (TSNSSAI) obj;
103         if (!Objects.equals(_uint8, other._uint8)) {
104             return false;
105         }
106         if (!Objects.equals(_uint32, other._uint32)) {
107             return false;
108         }
109         return true;
110     }
111
112     @Override
113     public String toString() {
114         final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(TSNSSAI.class);
115         CodeHelpers.appendValue(helper, "_uint8", _uint8);
116         CodeHelpers.appendValue(helper, "_uint32", _uint32);
117         return helper.toString();
118     }
119 }
120