blob: c7314a64b243154ccbc02bb61ebfa1d88586d2fc [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.api;
6
7import com.fasterxml.jackson.annotation.JsonIgnore;
8import org.onosproject.xran.asn1lib.ber.BerByteArrayOutputStream;
9import org.onosproject.xran.asn1lib.ber.BerLength;
10import org.onosproject.xran.asn1lib.ber.BerTag;
11import org.onosproject.xran.asn1lib.ber.types.BerEnum;
12
13import java.io.IOException;
14import java.io.InputStream;
15import java.io.Serializable;
16
17
18public class ReportConfig implements Serializable {
19
20 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
21 private static final long serialVersionUID = 1L;
22 @JsonIgnore
23 public byte[] code = null;
24 private ReportParams reportParams = null;
25 private BerEnum triggerQuantity = null;
26 private BerEnum reportQuantity = null;
27 public ReportConfig() {
28 }
29
30 public ReportConfig(byte[] code) {
31 this.code = code;
32 }
33
34 public ReportParams getReportParams() {
35 return reportParams;
36 }
37
38 public void setReportParams(ReportParams reportParams) {
39 this.reportParams = reportParams;
40 }
41
42 public BerEnum getTriggerQuantity() {
43 return triggerQuantity;
44 }
45
46 public void setTriggerQuantity(BerEnum triggerQuantity) {
47 this.triggerQuantity = triggerQuantity;
48 }
49
50 public BerEnum getReportQuantity() {
51 return reportQuantity;
52 }
53
54 public void setReportQuantity(BerEnum reportQuantity) {
55 this.reportQuantity = reportQuantity;
56 }
57
58 public int encode(BerByteArrayOutputStream os) throws IOException {
59 return encode(os, true);
60 }
61
62 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
63
64 if (code != null) {
65 for (int i = code.length - 1; i >= 0; i--) {
66 os.write(code[i]);
67 }
68 if (withTag) {
69 return tag.encode(os) + code.length;
70 }
71 return code.length;
72 }
73
74 int codeLength = 0;
75 codeLength += reportQuantity.encode(os, false);
76 // write tag: CONTEXT_CLASS, PRIMITIVE, 2
77 os.write(0x82);
78 codeLength += 1;
79
80 codeLength += triggerQuantity.encode(os, false);
81 // write tag: CONTEXT_CLASS, PRIMITIVE, 1
82 os.write(0x81);
83 codeLength += 1;
84
85 codeLength += reportParams.encode(os, false);
86 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
87 os.write(0xA0);
88 codeLength += 1;
89
90 codeLength += BerLength.encodeLength(os, codeLength);
91
92 if (withTag) {
93 codeLength += tag.encode(os);
94 }
95
96 return codeLength;
97
98 }
99
100 public int decode(InputStream is) throws IOException {
101 return decode(is, true);
102 }
103
104 public int decode(InputStream is, boolean withTag) throws IOException {
105 int codeLength = 0;
106 int subCodeLength = 0;
107 BerTag berTag = new BerTag();
108
109 if (withTag) {
110 codeLength += tag.decodeAndCheck(is);
111 }
112
113 BerLength length = new BerLength();
114 codeLength += length.decode(is);
115
116 int totalLength = length.val;
117 codeLength += totalLength;
118
119 subCodeLength += berTag.decode(is);
120 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
121 reportParams = new ReportParams();
122 subCodeLength += reportParams.decode(is, false);
123 subCodeLength += berTag.decode(is);
124 } else {
125 throw new IOException("Tag does not match the mandatory sequence element tag.");
126 }
127
128 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
129 triggerQuantity = new BerEnum();
130 subCodeLength += triggerQuantity.decode(is, false);
131 subCodeLength += berTag.decode(is);
132 } else {
133 throw new IOException("Tag does not match the mandatory sequence element tag.");
134 }
135
136 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
137 reportQuantity = new BerEnum();
138 subCodeLength += reportQuantity.decode(is, false);
139 if (subCodeLength == totalLength) {
140 return codeLength;
141 }
142 }
143 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
144
145
146 }
147
148 public void encodeAndSave(int encodingSizeGuess) throws IOException {
149 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
150 encode(os, false);
151 code = os.getArray();
152 }
153
154 public String toString() {
155 StringBuilder sb = new StringBuilder();
156 appendAsString(sb, 0);
157 return sb.toString();
158 }
159
160 public void appendAsString(StringBuilder sb, int indentLevel) {
161
162 sb.append("{");
163 sb.append("\n");
164 for (int i = 0; i < indentLevel + 1; i++) {
165 sb.append("\t");
166 }
167 if (reportParams != null) {
168 sb.append("reportParams: ");
169 reportParams.appendAsString(sb, indentLevel + 1);
170 } else {
171 sb.append("reportParams: <empty-required-field>");
172 }
173
174 sb.append(",\n");
175 for (int i = 0; i < indentLevel + 1; i++) {
176 sb.append("\t");
177 }
178 if (triggerQuantity != null) {
179 sb.append("triggerQuantity: ").append(triggerQuantity);
180 } else {
181 sb.append("triggerQuantity: <empty-required-field>");
182 }
183
184 sb.append(",\n");
185 for (int i = 0; i < indentLevel + 1; i++) {
186 sb.append("\t");
187 }
188 if (reportQuantity != null) {
189 sb.append("reportQuantity: ").append(reportQuantity);
190 } else {
191 sb.append("reportQuantity: <empty-required-field>");
192 }
193
194 sb.append("\n");
195 for (int i = 0; i < indentLevel; i++) {
196 sb.append("\t");
197 }
198 sb.append("}");
199 }
200
201 public static class ReportParams implements Serializable {
202
203 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
204 private static final long serialVersionUID = 1L;
205 @JsonIgnore
206 public byte[] code = null;
207 private Params params = null;
208 private Hysteresis hysteresis = null;
209 private TimeToTrigger timetotrigger = null;
210 public ReportParams() {
211 }
212
213 public ReportParams(byte[] code) {
214 this.code = code;
215 }
216
217 public Params getParams() {
218 return params;
219 }
220
221 public void setParams(Params params) {
222 this.params = params;
223 }
224
225 public Hysteresis getHysteresis() {
226 return hysteresis;
227 }
228
229 public void setHysteresis(Hysteresis hysteresis) {
230 this.hysteresis = hysteresis;
231 }
232
233 public TimeToTrigger getTimetotrigger() {
234 return timetotrigger;
235 }
236
237 public void setTimetotrigger(TimeToTrigger timetotrigger) {
238 this.timetotrigger = timetotrigger;
239 }
240
241 public int encode(BerByteArrayOutputStream os) throws IOException {
242 return encode(os, true);
243 }
244
245 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
246
247 if (code != null) {
248 for (int i = code.length - 1; i >= 0; i--) {
249 os.write(code[i]);
250 }
251 if (withTag) {
252 return tag.encode(os) + code.length;
253 }
254 return code.length;
255 }
256
257 int codeLength = 0;
258 int sublength;
259
260 codeLength += timetotrigger.encode(os, false);
261 // write tag: CONTEXT_CLASS, PRIMITIVE, 2
262 os.write(0x82);
263 codeLength += 1;
264
265 codeLength += hysteresis.encode(os, false);
266 // write tag: CONTEXT_CLASS, PRIMITIVE, 1
267 os.write(0x81);
268 codeLength += 1;
269
270 sublength = params.encode(os);
271 codeLength += sublength;
272 codeLength += BerLength.encodeLength(os, sublength);
273 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
274 os.write(0xA0);
275 codeLength += 1;
276
277 codeLength += BerLength.encodeLength(os, codeLength);
278
279 if (withTag) {
280 codeLength += tag.encode(os);
281 }
282
283 return codeLength;
284
285 }
286
287 public int decode(InputStream is) throws IOException {
288 return decode(is, true);
289 }
290
291 public int decode(InputStream is, boolean withTag) throws IOException {
292 int codeLength = 0;
293 int subCodeLength = 0;
294 BerTag berTag = new BerTag();
295
296 if (withTag) {
297 codeLength += tag.decodeAndCheck(is);
298 }
299
300 BerLength length = new BerLength();
301 codeLength += length.decode(is);
302
303 int totalLength = length.val;
304 codeLength += totalLength;
305
306 subCodeLength += berTag.decode(is);
307 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
308 subCodeLength += length.decode(is);
309 params = new Params();
310 subCodeLength += params.decode(is, null);
311 subCodeLength += berTag.decode(is);
312 } else {
313 throw new IOException("Tag does not match the mandatory sequence element tag.");
314 }
315
316 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
317 hysteresis = new Hysteresis();
318 subCodeLength += hysteresis.decode(is, false);
319 subCodeLength += berTag.decode(is);
320 } else {
321 throw new IOException("Tag does not match the mandatory sequence element tag.");
322 }
323
324 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
325 timetotrigger = new TimeToTrigger();
326 subCodeLength += timetotrigger.decode(is, false);
327 if (subCodeLength == totalLength) {
328 return codeLength;
329 }
330 }
331 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
332
333
334 }
335
336 public void encodeAndSave(int encodingSizeGuess) throws IOException {
337 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
338 encode(os, false);
339 code = os.getArray();
340 }
341
342 public String toString() {
343 StringBuilder sb = new StringBuilder();
344 appendAsString(sb, 0);
345 return sb.toString();
346 }
347
348 public void appendAsString(StringBuilder sb, int indentLevel) {
349
350 sb.append("{");
351 sb.append("\n");
352 for (int i = 0; i < indentLevel + 1; i++) {
353 sb.append("\t");
354 }
355 if (params != null) {
356 sb.append("params: ");
357 params.appendAsString(sb, indentLevel + 1);
358 } else {
359 sb.append("params: <empty-required-field>");
360 }
361
362 sb.append(",\n");
363 for (int i = 0; i < indentLevel + 1; i++) {
364 sb.append("\t");
365 }
366 if (hysteresis != null) {
367 sb.append("hysteresis: ").append(hysteresis);
368 } else {
369 sb.append("hysteresis: <empty-required-field>");
370 }
371
372 sb.append(",\n");
373 for (int i = 0; i < indentLevel + 1; i++) {
374 sb.append("\t");
375 }
376 if (timetotrigger != null) {
377 sb.append("timetotrigger: ").append(timetotrigger);
378 } else {
379 sb.append("timetotrigger: <empty-required-field>");
380 }
381
382 sb.append("\n");
383 for (int i = 0; i < indentLevel; i++) {
384 sb.append("\t");
385 }
386 sb.append("}");
387 }
388
389 public static class Params implements Serializable {
390
391 private static final long serialVersionUID = 1L;
392
393 @JsonIgnore
394 public byte[] code = null;
395 private PerParam perParam = null;
396 private A1Param a1param = null;
397 private A2Param a2param = null;
398 private A3Param a3param = null;
399 private A4Param a4param = null;
400 private A5Param a5param = null;
401 private A6Param a6param = null;
402
403 public Params() {
404 }
405
406 public Params(byte[] code) {
407 this.code = code;
408 }
409
410 public PerParam getPerParam() {
411 return perParam;
412 }
413
414 public void setPerParam(PerParam perParam) {
415 this.perParam = perParam;
416 }
417
418 public A1Param getA1param() {
419 return a1param;
420 }
421
422 public void setA1param(A1Param a1param) {
423 this.a1param = a1param;
424 }
425
426 public A2Param getA2param() {
427 return a2param;
428 }
429
430 public void setA2param(A2Param a2param) {
431 this.a2param = a2param;
432 }
433
434 public A3Param getA3param() {
435 return a3param;
436 }
437
438 public void setA3param(A3Param a3param) {
439 this.a3param = a3param;
440 }
441
442 public A4Param getA4param() {
443 return a4param;
444 }
445
446 public void setA4param(A4Param a4param) {
447 this.a4param = a4param;
448 }
449
450 public A5Param getA5param() {
451 return a5param;
452 }
453
454 public void setA5param(A5Param a5param) {
455 this.a5param = a5param;
456 }
457
458 public A6Param getA6param() {
459 return a6param;
460 }
461
462 public void setA6param(A6Param a6param) {
463 this.a6param = a6param;
464 }
465
466 public int encode(BerByteArrayOutputStream os) throws IOException {
467
468 if (code != null) {
469 for (int i = code.length - 1; i >= 0; i--) {
470 os.write(code[i]);
471 }
472 return code.length;
473 }
474
475 int codeLength = 0;
476 if (a6param != null) {
477 codeLength += a6param.encode(os, false);
478 // write tag: CONTEXT_CLASS, CONSTRUCTED, 6
479 os.write(0xA6);
480 codeLength += 1;
481 return codeLength;
482 }
483
484 if (a5param != null) {
485 codeLength += a5param.encode(os, false);
486 // write tag: CONTEXT_CLASS, CONSTRUCTED, 5
487 os.write(0xA5);
488 codeLength += 1;
489 return codeLength;
490 }
491
492 if (a4param != null) {
493 codeLength += a4param.encode(os, false);
494 // write tag: CONTEXT_CLASS, CONSTRUCTED, 4
495 os.write(0xA4);
496 codeLength += 1;
497 return codeLength;
498 }
499
500 if (a3param != null) {
501 codeLength += a3param.encode(os, false);
502 // write tag: CONTEXT_CLASS, CONSTRUCTED, 3
503 os.write(0xA3);
504 codeLength += 1;
505 return codeLength;
506 }
507
508 if (a2param != null) {
509 codeLength += a2param.encode(os, false);
510 // write tag: CONTEXT_CLASS, CONSTRUCTED, 2
511 os.write(0xA2);
512 codeLength += 1;
513 return codeLength;
514 }
515
516 if (a1param != null) {
517 codeLength += a1param.encode(os, false);
518 // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
519 os.write(0xA1);
520 codeLength += 1;
521 return codeLength;
522 }
523
524 if (perParam != null) {
525 codeLength += perParam.encode(os, false);
526 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
527 os.write(0xA0);
528 codeLength += 1;
529 return codeLength;
530 }
531
532 throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
533 }
534
535 public int decode(InputStream is) throws IOException {
536 return decode(is, null);
537 }
538
539 public int decode(InputStream is, BerTag berTag) throws IOException {
540
541 int codeLength = 0;
542 BerTag passedTag = berTag;
543
544 if (berTag == null) {
545 berTag = new BerTag();
546 codeLength += berTag.decode(is);
547 }
548
549 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
550 perParam = new PerParam();
551 codeLength += perParam.decode(is, false);
552 return codeLength;
553 }
554
555 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
556 a1param = new A1Param();
557 codeLength += a1param.decode(is, false);
558 return codeLength;
559 }
560
561 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
562 a2param = new A2Param();
563 codeLength += a2param.decode(is, false);
564 return codeLength;
565 }
566
567 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
568 a3param = new A3Param();
569 codeLength += a3param.decode(is, false);
570 return codeLength;
571 }
572
573 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
574 a4param = new A4Param();
575 codeLength += a4param.decode(is, false);
576 return codeLength;
577 }
578
579 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
580 a5param = new A5Param();
581 codeLength += a5param.decode(is, false);
582 return codeLength;
583 }
584
585 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
586 a6param = new A6Param();
587 codeLength += a6param.decode(is, false);
588 return codeLength;
589 }
590
591 if (passedTag != null) {
592 return 0;
593 }
594
595 throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
596 }
597
598 public void encodeAndSave(int encodingSizeGuess) throws IOException {
599 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
600 encode(os);
601 code = os.getArray();
602 }
603
604 public String toString() {
605 StringBuilder sb = new StringBuilder();
606 appendAsString(sb, 0);
607 return sb.toString();
608 }
609
610 public void appendAsString(StringBuilder sb, int indentLevel) {
611
612 if (perParam != null) {
613 sb.append("perParam: ");
614 perParam.appendAsString(sb, indentLevel + 1);
615 return;
616 }
617
618 if (a1param != null) {
619 sb.append("a1param: ");
620 a1param.appendAsString(sb, indentLevel + 1);
621 return;
622 }
623
624 if (a2param != null) {
625 sb.append("a2param: ");
626 a2param.appendAsString(sb, indentLevel + 1);
627 return;
628 }
629
630 if (a3param != null) {
631 sb.append("a3param: ");
632 a3param.appendAsString(sb, indentLevel + 1);
633 return;
634 }
635
636 if (a4param != null) {
637 sb.append("a4param: ");
638 a4param.appendAsString(sb, indentLevel + 1);
639 return;
640 }
641
642 if (a5param != null) {
643 sb.append("a5param: ");
644 a5param.appendAsString(sb, indentLevel + 1);
645 return;
646 }
647
648 if (a6param != null) {
649 sb.append("a6param: ");
650 a6param.appendAsString(sb, indentLevel + 1);
651 return;
652 }
653
654 sb.append("<none>");
655 }
656
657 }
658
659 }
660
661}
662