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