@@ -439,14 +439,22 @@ public BodyDeclaration<?> toMethodDeclaration() {
439
439
String .format (
440
440
"return new Event<>(\" %s.%s\" , ConverterFunctions.empty());" ,
441
441
domain .name , name ));
442
- } else if (type instanceof ObjectType || type instanceof ArrayType ) {
442
+ } else if (type instanceof ObjectType ) {
443
443
methodDecl
444
444
.getBody ()
445
445
.get ()
446
446
.addStatement (
447
447
String .format (
448
448
"return new Event<>(\" %s.%s\" , input -> %s);" ,
449
449
domain .name , name , type .getMapper ()));
450
+ } else if (type instanceof ArrayType ) {
451
+ methodDecl
452
+ .getBody ()
453
+ .get ()
454
+ .addStatement (
455
+ String .format (
456
+ "return new Event<>(\" %s.%s\" , ConverterFunctions.map(\" %s\" , input -> %s));" ,
457
+ domain .name , name , type .getName (), type .getMapper ()));
450
458
} else {
451
459
methodDecl
452
460
.getBody ()
@@ -660,11 +668,17 @@ public MethodDeclaration toMethodDeclaration() {
660
668
body .addStatement (
661
669
String .format (
662
670
"return new Command<>(\" %s.%s\" , Map.copyOf(params));" , domain .name , name ));
663
- } else if (type instanceof ObjectType || type instanceof ArrayType ) {
671
+ } else if (type instanceof ObjectType ) {
664
672
body .addStatement (
665
673
String .format (
666
674
"return new Command<>(\" %s.%s\" , Map.copyOf(params), input -> %s);" ,
667
675
domain .name , name , type .getMapper ()));
676
+ } else if (type instanceof ArrayType ) {
677
+ body .addStatement (
678
+ String .format (
679
+ "return new Command<>(\" %s.%s\" , Map.copyOf(params), ConverterFunctions.map(\" %s\" ,"
680
+ + " input -> %s));" ,
681
+ domain .name , name , type .getName (), type .getMapper ()));
668
682
} else {
669
683
body .addStatement (
670
684
String .format (
0 commit comments