1111import java .util .Objects ;
1212import java .util .Optional ;
1313
14- public final class Value <S extends GeneratedMessageV3 , R extends GeneratedMessageV3 > {
15-
16- private S state ;
17- private R response ;
14+ public final class Value {
1815
16+ private Object state ;
17+ private Object response ;
1918 private boolean checkpoint ;
2019 private Optional <Broadcast <?>> broadcast ;
2120 private Optional <Forward > forward ;
2221 private Optional <Pipe > pipe ;
23- private Optional <List <SideEffect >> effects ;
24-
25- private ResponseType type ;
22+ private Optional <List <SideEffect <?>>> effects ;
23+ private final ResponseType type ;
2624
2725 private Value () {
2826 this .state = null ;
@@ -36,13 +34,13 @@ private Value() {
3634 }
3735
3836 private Value (
39- R response ,
40- S state ,
37+ Object response ,
38+ Object state ,
4139 boolean checkpoint ,
4240 Optional <Broadcast <?>> broadcast ,
4341 Optional <Forward > forward ,
4442 Optional <Pipe > pipe ,
45- Optional <List <SideEffect >> effects ,
43+ Optional <List <SideEffect <?> >> effects ,
4644 ResponseType type ) {
4745 this .response = response ;
4846 this .state = state ;
@@ -54,16 +52,16 @@ private Value(
5452 this .type = type ;
5553 }
5654
57- public static < S , V > Value at () {
55+ public static Value at () {
5856 return new Value ();
5957 }
6058
61- public R getResponse () {
62- return response ;
59+ public < R extends GeneratedMessageV3 > R getResponse () {
60+ return ( R ) response ;
6361 }
6462
65- public S getState () {
66- return state ;
63+ public < S extends GeneratedMessageV3 > S getState () {
64+ return ( S ) state ;
6765 }
6866
6967 public boolean getCheckpoint () {
@@ -82,31 +80,31 @@ public Optional<Pipe> getPipe() {
8280 return pipe ;
8381 }
8482
85- public Optional <List <SideEffect >> getEffects () {
83+ public Optional <List <SideEffect <?> >> getEffects () {
8684 return effects ;
8785 }
8886
8987 public ResponseType getType () {
9088 return type ;
9189 }
9290
93- public Value response (R value ) {
91+ public Value response (Object value ) {
9492 this .response = value ;
9593 return this ;
9694 }
9795
98- public Value state (S state ) {
96+ public < S extends GeneratedMessageV3 > Value state (S state ) {
9997 this .state = state ;
10098 return this ;
10199 }
102100
103- public Value state (S state , boolean checkpoint ) {
101+ public < S extends GeneratedMessageV3 > Value state (S state , boolean checkpoint ) {
104102 this .state = state ;
105103 this .checkpoint = checkpoint ;
106104 return this ;
107105 }
108106
109- public Value flow (Broadcast broadcast ) {
107+ public Value flow (Broadcast <?> broadcast ) {
110108 this .broadcast = Optional .of (broadcast );
111109 return this ;
112110 }
@@ -121,8 +119,8 @@ public Value flow(Pipe pipe) {
121119 return this ;
122120 }
123121
124- public Value flow (SideEffect effect ) {
125- List <SideEffect > ef ;
122+ public Value flow (SideEffect <?> effect ) {
123+ List <SideEffect <?> > ef ;
126124 if (this .effects .isPresent ()) {
127125 ef = this .effects .get ();
128126 ef .add (effect );
@@ -135,7 +133,7 @@ public Value flow(SideEffect effect) {
135133 return this ;
136134 }
137135
138- public Value flow (List <SideEffect > effects ) {
136+ public Value flow (List <SideEffect <?> > effects ) {
139137 this .effects = Optional .of (effects );
140138 return this ;
141139 }
@@ -171,7 +169,7 @@ public String toString() {
171169 public boolean equals (Object o ) {
172170 if (this == o ) return true ;
173171 if (o == null || getClass () != o .getClass ()) return false ;
174- Value <?, ?> value = (Value <?, ?> ) o ;
172+ Value value = (Value ) o ;
175173 return Objects .equals (state , value .state ) &&
176174 Objects .equals (response , value .response ) &&
177175 Objects .equals (checkpoint , value .checkpoint ) &&
0 commit comments