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;
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;
13 implements TypeObject, Serializable {
14 private static final long serialVersionUID = -2943261658086489871L;
15 private final Short _uint8;
16 private final Long _uint32;
19 private static void checkUint8Range(final short value) {
20 if (value >= (short)0 && value <= (short)255) {
23 CodeHelpers.throwInvalidRange("[[0..255]]", value);
25 public TSNSSAI(Short _uint8) {
27 checkUint8Range(_uint8);
33 private static void checkUint32Range(final long value) {
34 if (value >= 0L && value <= 4294967295L) {
37 CodeHelpers.throwInvalidRange("[[0..4294967295]]", value);
39 public TSNSSAI(Long _uint32) {
41 checkUint32Range(_uint32);
43 this._uint32 = _uint32;
47 * Creates a copy from Source Object.
49 * @param source Source object
51 public TSNSSAI(TSNSSAI source) {
52 this._uint8 = source._uint8;
53 this._uint32 = source._uint32;
57 * Return a String representing the value of this union.
59 * @return String representation of this union's value.
61 public String stringValue() {
63 return _uint8.toString();
65 if (_uint32 != null) {
66 return _uint32.toString();
69 throw new IllegalStateException("No value assinged");
73 public Short getUint8() {
77 public Long getUint32() {
83 public int hashCode() {
86 result = prime * result + Objects.hashCode(_uint8);
87 result = prime * result + Objects.hashCode(_uint32);
92 public boolean equals(java.lang.Object obj) {
99 if (getClass() != obj.getClass()) {
102 TSNSSAI other = (TSNSSAI) obj;
103 if (!Objects.equals(_uint8, other._uint8)) {
106 if (!Objects.equals(_uint32, other._uint32)) {
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();