11package io .temporal .samples .workerversioning ;
22
3+ import com .fasterxml .jackson .annotation .JsonCreator ;
4+ import com .fasterxml .jackson .annotation .JsonProperty ;
35import io .temporal .activity .ActivityInterface ;
46import io .temporal .activity .ActivityMethod ;
57
@@ -13,30 +15,24 @@ public interface Activities {
1315 String someIncompatibleActivity (IncompatibleActivityInput input );
1416
1517 class IncompatibleActivityInput {
16- String calledBy ;
17- String moreData ;
18+ private final String calledBy ;
19+ private final String moreData ;
1820
19- public IncompatibleActivityInput () {}
20-
21- public IncompatibleActivityInput ( String calledBy , String moreData ) {
21+ @ JsonCreator ( mode = JsonCreator . Mode . PROPERTIES )
22+ public IncompatibleActivityInput (
23+ @ JsonProperty ( "calledBy" ) String calledBy , @ JsonProperty ( "moreData" ) String moreData ) {
2224 this .calledBy = calledBy ;
2325 this .moreData = moreData ;
2426 }
2527
28+ @ JsonProperty ("calledBy" )
2629 public String getCalledBy () {
2730 return calledBy ;
2831 }
2932
33+ @ JsonProperty ("moreData" )
3034 public String getMoreData () {
3135 return moreData ;
3236 }
33-
34- public void setCalledBy (String calledBy ) {
35- this .calledBy = calledBy ;
36- }
37-
38- public void setMoreData (String moreData ) {
39- this .moreData = moreData ;
40- }
4137 }
4238}
0 commit comments