@@ -403,16 +403,47 @@ export function __near_decode_ContainerClass(
403
403
return handler.value;
404
404
}
405
405
406
+ export function __near_encode_Array_FooBar(
407
+ value: Array<wrapped_FooBar>,
408
+ encoder: JSONEncoder
409
+ ): void {
410
+ for (let i = 0; i < value.length; i++) {
411
+ if (value[i] != null) {
412
+ encoder.pushObject(null);
413
+ __near_encode_FooBar(<FooBar>value[i], encoder);
414
+ encoder.popObject();
415
+ } else {
416
+ encoder.setNull(null);
417
+ }
418
+ }
419
+ }
420
+ export function __near_encode_Array_Array_FooBar(
421
+ value: Array<Array<wrapped_FooBar>>,
422
+ encoder: JSONEncoder
423
+ ): void {
424
+ for (let i = 0; i < value.length; i++) {
425
+ if (value[i] != null) {
426
+ encoder.pushArray(null);
427
+ __near_encode_Array_FooBar(<Array<FooBar>>value[i], encoder);
428
+ encoder.popArray();
429
+ } else {
430
+ encoder.setNull(null);
431
+ }
432
+ }
433
+ }
406
434
export function __near_encode_AnotherContainerClass(
407
435
value: wrapped_AnotherContainerClass,
408
436
encoder: JSONEncoder
409
437
): void {
410
- if (value.foobar != null) {
411
- encoder.pushObject("foobar");
412
- __near_encode_FooBar(<FooBar>value.foobar, encoder);
413
- encoder.popObject();
438
+ if (value.foobars != null) {
439
+ encoder.pushArray("foobars");
440
+ __near_encode_Array_Array_FooBar(
441
+ <Array<Array<FooBar>>>value.foobars,
442
+ encoder
443
+ );
444
+ encoder.popArray();
414
445
} else {
415
- encoder.setNull("foobar ");
446
+ encoder.setNull("foobars ");
416
447
}
417
448
}
418
449
export class __near_JSONHandler_AnotherContainerClass extends ThrowingJSONHandler {
@@ -421,8 +452,8 @@ export class __near_JSONHandler_AnotherContainerClass extends ThrowingJSONHandle
421
452
handledRoot: boolean = false;
422
453
value: wrapped_AnotherContainerClass = new wrapped_AnotherContainerClass();
423
454
setNull(name: string): void {
424
- if (name == "foobar ") {
425
- this.value.foobar = <wrapped_FooBar>null;
455
+ if (name == "foobars ") {
456
+ this.value.foobars = <Array<Array< wrapped_FooBar>> >null;
426
457
return;
427
458
}
428
459
@@ -437,19 +468,92 @@ export class __near_JSONHandler_AnotherContainerClass extends ThrowingJSONHandle
437
468
} else {
438
469
assert(name != null);
439
470
}
440
- if (name == "foobar") {
441
- this.value.foobar = <FooBar>(
442
- __near_decode_FooBar(this.buffer, this.decoder.state)
471
+
472
+ return super.pushObject(name);
473
+ }
474
+
475
+ pushArray(name: string): bool {
476
+ if (name == "foobars") {
477
+ this.value.foobars = <Array<Array<FooBar>>>(
478
+ __near_decode_Array_Array_FooBar(this.buffer, this.decoder.state)
443
479
);
444
480
return false;
445
481
}
446
482
447
- return super.pushObject (name);
483
+ return super.pushArray (name);
448
484
}
485
+ }
449
486
487
+ export class __near_JSONHandler_Array_Array_FooBar extends ThrowingJSONHandler {
488
+ buffer: Uint8Array;
489
+ decoder: JSONDecoder<__near_JSONHandler_Array_Array_FooBar>;
490
+ handledRoot: boolean = false;
491
+ value: Array<Array<wrapped_FooBar>> = new Array<Array<wrapped_FooBar>>();
492
+ pushObject(name: string): bool {
493
+ this.value.push(<Array<FooBar>>(
494
+ __near_decode_Array_FooBar(this.buffer, this.decoder.state)
495
+ ));
496
+ return false;
497
+ }
450
498
pushArray(name: string): bool {
451
- return super.pushArray(name);
499
+ assert(name == null);
500
+ if (!this.handledRoot) {
501
+ this.handledRoot = true;
502
+ return true;
503
+ }
504
+ this.value.push(<Array<FooBar>>(
505
+ __near_decode_Array_FooBar(this.buffer, this.decoder.state)
506
+ ));
507
+ return false;
508
+ }
509
+ }
510
+
511
+ export class __near_JSONHandler_Array_FooBar extends ThrowingJSONHandler {
512
+ buffer: Uint8Array;
513
+ decoder: JSONDecoder<__near_JSONHandler_Array_FooBar>;
514
+ handledRoot: boolean = false;
515
+ value: Array<wrapped_FooBar> = new Array<wrapped_FooBar>();
516
+ pushObject(name: string): bool {
517
+ this.value.push(<FooBar>(
518
+ __near_decode_FooBar(this.buffer, this.decoder.state)
519
+ ));
520
+ return false;
452
521
}
522
+ pushArray(name: string): bool {
523
+ assert(name == null);
524
+ if (!this.handledRoot) {
525
+ this.handledRoot = true;
526
+ return true;
527
+ }
528
+ this.value.push(<FooBar>(
529
+ __near_decode_FooBar(this.buffer, this.decoder.state)
530
+ ));
531
+ return false;
532
+ }
533
+ }
534
+
535
+ export function __near_decode_Array_FooBar(
536
+ buffer: Uint8Array,
537
+ state: DecoderState
538
+ ): Array<wrapped_FooBar> {
539
+ let handler = new __near_JSONHandler_Array_FooBar();
540
+ handler.buffer = buffer;
541
+ handler.decoder = new JSONDecoder<__near_JSONHandler_Array_FooBar>(handler);
542
+ handler.decoder.deserialize(buffer, state);
543
+ return handler.value;
544
+ }
545
+
546
+ export function __near_decode_Array_Array_FooBar(
547
+ buffer: Uint8Array,
548
+ state: DecoderState
549
+ ): Array<Array<wrapped_FooBar>> {
550
+ let handler = new __near_JSONHandler_Array_Array_FooBar();
551
+ handler.buffer = buffer;
552
+ handler.decoder = new JSONDecoder<__near_JSONHandler_Array_Array_FooBar>(
553
+ handler
554
+ );
555
+ handler.decoder.deserialize(buffer, state);
556
+ return handler.value;
453
557
}
454
558
455
559
export function __near_decode_AnotherContainerClass(
0 commit comments