blob: 60838a07a6471c80eaef8281e916f20751f0064a [file] [log] [blame]
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001/**
2 * This class file was automatically generated by jASN1 v1.8.2 (http://www.openmuc.org)
3 */
4
5package org.onosproject.xran.asn1lib.pdu;
6
7import com.fasterxml.jackson.annotation.JsonIgnore;
8import com.fasterxml.jackson.annotation.JsonValue;
9import org.onosproject.xran.asn1lib.api.ECGI;
10import org.onosproject.xran.asn1lib.ber.BerByteArrayOutputStream;
11import org.onosproject.xran.asn1lib.ber.BerLength;
12import org.onosproject.xran.asn1lib.ber.BerTag;
13import org.onosproject.xran.asn1lib.ber.types.BerInteger;
14
15import java.io.IOException;
16import java.io.InputStream;
17import java.io.Serializable;
18import java.util.ArrayList;
19import java.util.Iterator;
20import java.util.List;
21
22public class RadioMeasReportPerCell implements Serializable {
23
24 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
25 private static final long serialVersionUID = 1L;
26 @JsonIgnore
27 public byte[] code = null;
28 private ECGI ecgi = null;
29 private PuschIntfPowerHist puschIntfPowerHist = null;
30 private PucchIntfPowerHist pucchIntfPowerHist = null;
31
32 public RadioMeasReportPerCell() {
33 }
34
35 public RadioMeasReportPerCell(byte[] code) {
36 this.code = code;
37 }
38
39 public ECGI getEcgi() {
40 return ecgi;
41 }
42
43 public void setEcgi(ECGI ecgi) {
44 this.ecgi = ecgi;
45 }
46
47 public PuschIntfPowerHist getPuschIntfPowerHist() {
48 return puschIntfPowerHist;
49 }
50
51 public void setPuschIntfPowerHist(PuschIntfPowerHist puschIntfPowerHist) {
52 this.puschIntfPowerHist = puschIntfPowerHist;
53 }
54
55 public PucchIntfPowerHist getPucchIntfPowerHist() {
56 return pucchIntfPowerHist;
57 }
58
59 public void setPucchIntfPowerHist(PucchIntfPowerHist pucchIntfPowerHist) {
60 this.pucchIntfPowerHist = pucchIntfPowerHist;
61 }
62
63 public int encode(BerByteArrayOutputStream os) throws IOException {
64 return encode(os, true);
65 }
66
67 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
68
69 if (code != null) {
70 for (int i = code.length - 1; i >= 0; i--) {
71 os.write(code[i]);
72 }
73 if (withTag) {
74 return tag.encode(os) + code.length;
75 }
76 return code.length;
77 }
78
79 int codeLength = 0;
80 codeLength += pucchIntfPowerHist.encode(os, false);
81 // write tag: CONTEXT_CLASS, CONSTRUCTED, 2
82 os.write(0xA2);
83 codeLength += 1;
84
85 codeLength += puschIntfPowerHist.encode(os, false);
86 // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
87 os.write(0xA1);
88 codeLength += 1;
89
90 codeLength += ecgi.encode(os, false);
91 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
92 os.write(0xA0);
93 codeLength += 1;
94
95 codeLength += BerLength.encodeLength(os, codeLength);
96
97 if (withTag) {
98 codeLength += tag.encode(os);
99 }
100
101 return codeLength;
102
103 }
104
105 public int decode(InputStream is) throws IOException {
106 return decode(is, true);
107 }
108
109 public int decode(InputStream is, boolean withTag) throws IOException {
110 int codeLength = 0;
111 int subCodeLength = 0;
112 BerTag berTag = new BerTag();
113
114 if (withTag) {
115 codeLength += tag.decodeAndCheck(is);
116 }
117
118 BerLength length = new BerLength();
119 codeLength += length.decode(is);
120
121 int totalLength = length.val;
122 codeLength += totalLength;
123
124 subCodeLength += berTag.decode(is);
125 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
126 ecgi = new ECGI();
127 subCodeLength += ecgi.decode(is, false);
128 subCodeLength += berTag.decode(is);
129 } else {
130 throw new IOException("Tag does not match the mandatory sequence element tag.");
131 }
132
133 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
134 puschIntfPowerHist = new PuschIntfPowerHist();
135 subCodeLength += puschIntfPowerHist.decode(is, false);
136 subCodeLength += berTag.decode(is);
137 } else {
138 throw new IOException("Tag does not match the mandatory sequence element tag.");
139 }
140
141 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
142 pucchIntfPowerHist = new PucchIntfPowerHist();
143 subCodeLength += pucchIntfPowerHist.decode(is, false);
144 if (subCodeLength == totalLength) {
145 return codeLength;
146 }
147 }
148 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
149
150
151 }
152
153 public void encodeAndSave(int encodingSizeGuess) throws IOException {
154 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
155 encode(os, false);
156 code = os.getArray();
157 }
158
159 public String toString() {
160 StringBuilder sb = new StringBuilder();
161 appendAsString(sb, 0);
162 return sb.toString();
163 }
164
165 public void appendAsString(StringBuilder sb, int indentLevel) {
166
167 sb.append("{");
168 sb.append("\n");
169 for (int i = 0; i < indentLevel + 1; i++) {
170 sb.append("\t");
171 }
172 if (ecgi != null) {
173 sb.append("ecgi: ");
174 ecgi.appendAsString(sb, indentLevel + 1);
175 } else {
176 sb.append("ecgi: <empty-required-field>");
177 }
178
179 sb.append(",\n");
180 for (int i = 0; i < indentLevel + 1; i++) {
181 sb.append("\t");
182 }
183 if (puschIntfPowerHist != null) {
184 sb.append("puschIntfPowerHist: ");
185 puschIntfPowerHist.appendAsString(sb, indentLevel + 1);
186 } else {
187 sb.append("puschIntfPowerHist: <empty-required-field>");
188 }
189
190 sb.append(",\n");
191 for (int i = 0; i < indentLevel + 1; i++) {
192 sb.append("\t");
193 }
194 if (pucchIntfPowerHist != null) {
195 sb.append("pucchIntfPowerHist: ");
196 pucchIntfPowerHist.appendAsString(sb, indentLevel + 1);
197 } else {
198 sb.append("pucchIntfPowerHist: <empty-required-field>");
199 }
200
201 sb.append("\n");
202 for (int i = 0; i < indentLevel; i++) {
203 sb.append("\t");
204 }
205 sb.append("}");
206 }
207
208 public static class PuschIntfPowerHist implements Serializable {
209
210 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
211 private static final long serialVersionUID = 1L;
212 @JsonIgnore
213 public byte[] code = null;
214 private List<BerInteger> seqOf = null;
215
216 public PuschIntfPowerHist() {
217 seqOf = new ArrayList<BerInteger>();
218 }
219
220 public PuschIntfPowerHist(byte[] code) {
221 this.code = code;
222 }
223
224 @JsonValue
225 public List<BerInteger> getBerInteger() {
226 if (seqOf == null) {
227 seqOf = new ArrayList<BerInteger>();
228 }
229 return seqOf;
230 }
231
232 public int encode(BerByteArrayOutputStream os) throws IOException {
233 return encode(os, true);
234 }
235
236 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
237
238 if (code != null) {
239 for (int i = code.length - 1; i >= 0; i--) {
240 os.write(code[i]);
241 }
242 if (withTag) {
243 return tag.encode(os) + code.length;
244 }
245 return code.length;
246 }
247
248 int codeLength = 0;
249 for (int i = (seqOf.size() - 1); i >= 0; i--) {
250 codeLength += seqOf.get(i).encode(os, true);
251 }
252
253 codeLength += BerLength.encodeLength(os, codeLength);
254
255 if (withTag) {
256 codeLength += tag.encode(os);
257 }
258
259 return codeLength;
260 }
261
262 public int decode(InputStream is) throws IOException {
263 return decode(is, true);
264 }
265
266 public int decode(InputStream is, boolean withTag) throws IOException {
267 int codeLength = 0;
268 int subCodeLength = 0;
269 if (withTag) {
270 codeLength += tag.decodeAndCheck(is);
271 }
272
273 BerLength length = new BerLength();
274 codeLength += length.decode(is);
275 int totalLength = length.val;
276
277 while (subCodeLength < totalLength) {
278 BerInteger element = new BerInteger();
279 subCodeLength += element.decode(is, true);
280 seqOf.add(element);
281 }
282 if (subCodeLength != totalLength) {
283 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
284
285 }
286 codeLength += subCodeLength;
287
288 return codeLength;
289 }
290
291 public void encodeAndSave(int encodingSizeGuess) throws IOException {
292 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
293 encode(os, false);
294 code = os.getArray();
295 }
296
297 public String toString() {
298 StringBuilder sb = new StringBuilder();
299 appendAsString(sb, 0);
300 return sb.toString();
301 }
302
303 public void appendAsString(StringBuilder sb, int indentLevel) {
304
305 sb.append("{\n");
306 for (int i = 0; i < indentLevel + 1; i++) {
307 sb.append("\t");
308 }
309 if (seqOf == null) {
310 sb.append("null");
311 } else {
312 Iterator<BerInteger> it = seqOf.iterator();
313 if (it.hasNext()) {
314 sb.append(it.next());
315 while (it.hasNext()) {
316 sb.append(",\n");
317 for (int i = 0; i < indentLevel + 1; i++) {
318 sb.append("\t");
319 }
320 sb.append(it.next());
321 }
322 }
323 }
324
325 sb.append("\n");
326 for (int i = 0; i < indentLevel; i++) {
327 sb.append("\t");
328 }
329 sb.append("}");
330 }
331
332 }
333
334 public static class PucchIntfPowerHist implements Serializable {
335
336 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
337 private static final long serialVersionUID = 1L;
338 @JsonIgnore
339 public byte[] code = null;
340 private List<BerInteger> seqOf = null;
341
342 public PucchIntfPowerHist() {
343 seqOf = new ArrayList<BerInteger>();
344 }
345
346 public PucchIntfPowerHist(byte[] code) {
347 this.code = code;
348 }
349
350 @JsonValue
351 public List<BerInteger> getBerInteger() {
352 if (seqOf == null) {
353 seqOf = new ArrayList<BerInteger>();
354 }
355 return seqOf;
356 }
357
358 public int encode(BerByteArrayOutputStream os) throws IOException {
359 return encode(os, true);
360 }
361
362 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
363
364 if (code != null) {
365 for (int i = code.length - 1; i >= 0; i--) {
366 os.write(code[i]);
367 }
368 if (withTag) {
369 return tag.encode(os) + code.length;
370 }
371 return code.length;
372 }
373
374 int codeLength = 0;
375 for (int i = (seqOf.size() - 1); i >= 0; i--) {
376 codeLength += seqOf.get(i).encode(os, true);
377 }
378
379 codeLength += BerLength.encodeLength(os, codeLength);
380
381 if (withTag) {
382 codeLength += tag.encode(os);
383 }
384
385 return codeLength;
386 }
387
388 public int decode(InputStream is) throws IOException {
389 return decode(is, true);
390 }
391
392 public int decode(InputStream is, boolean withTag) throws IOException {
393 int codeLength = 0;
394 int subCodeLength = 0;
395 if (withTag) {
396 codeLength += tag.decodeAndCheck(is);
397 }
398
399 BerLength length = new BerLength();
400 codeLength += length.decode(is);
401 int totalLength = length.val;
402
403 while (subCodeLength < totalLength) {
404 BerInteger element = new BerInteger();
405 subCodeLength += element.decode(is, true);
406 seqOf.add(element);
407 }
408 if (subCodeLength != totalLength) {
409 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
410
411 }
412 codeLength += subCodeLength;
413
414 return codeLength;
415 }
416
417 public void encodeAndSave(int encodingSizeGuess) throws IOException {
418 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
419 encode(os, false);
420 code = os.getArray();
421 }
422
423 public String toString() {
424 StringBuilder sb = new StringBuilder();
425 appendAsString(sb, 0);
426 return sb.toString();
427 }
428
429 public void appendAsString(StringBuilder sb, int indentLevel) {
430
431 sb.append("{\n");
432 for (int i = 0; i < indentLevel + 1; i++) {
433 sb.append("\t");
434 }
435 if (seqOf == null) {
436 sb.append("null");
437 } else {
438 Iterator<BerInteger> it = seqOf.iterator();
439 if (it.hasNext()) {
440 sb.append(it.next());
441 while (it.hasNext()) {
442 sb.append(",\n");
443 for (int i = 0; i < indentLevel + 1; i++) {
444 sb.append("\t");
445 }
446 sb.append(it.next());
447 }
448 }
449 }
450
451 sb.append("\n");
452 for (int i = 0; i < indentLevel; i++) {
453 sb.append("\t");
454 }
455 sb.append("}");
456 }
457
458 }
459
460}
461