File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,9 @@ public Object serialize(Object input) {
171171 if (input instanceof String ) {
172172 return input ;
173173 }
174+ if (input instanceof Integer ) {
175+ return String .valueOf (input );
176+ }
174177
175178 return null ;
176179 }
@@ -182,8 +185,13 @@ public Object parseValue(Object input) {
182185
183186 @ Override
184187 public Object parseLiteral (Object input ) {
185- if (!(input instanceof StringValue )) return null ;
186- return ((StringValue ) input ).getValue ();
188+ if (input instanceof StringValue ) {
189+ return ((StringValue ) input ).getValue ();
190+ }
191+ if (input instanceof IntValue ) {
192+ return ((IntValue ) input ).getValue ().toString ();
193+ }
194+ return null ;
187195 }
188196 });
189197
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class ScalarsTest extends Specification {
4343 where :
4444 literal | result
4545 new StringValue (" 5457486ABSBHS4w646" ) | " 5457486ABSBHS4w646"
46+ new IntValue (BigInteger . ONE ) | " 1"
4647 }
4748
4849 @Unroll
@@ -54,6 +55,7 @@ class ScalarsTest extends Specification {
5455 where :
5556 value | result
5657 " 5457486ABSBHS4w646" | " 5457486ABSBHS4w646"
58+ 1 | " 1"
5759 null | null
5860 }
5961
You can’t perform that action at this time.
0 commit comments