@@ -22,25 +22,25 @@ public class Scalars {
2222 private static final BigInteger SHORT_MAX = BigInteger .valueOf (Short .MAX_VALUE );
2323 private static final BigInteger SHORT_MIN = BigInteger .valueOf (Short .MIN_VALUE );
2424
25- public static GraphQLScalarType GraphQLInt = new GraphQLScalarType ("Int" , "Built-in Int" , new Coercing () {
25+ public static GraphQLScalarType GraphQLInt = new GraphQLScalarType ("Int" , "Built-in Int" , new Coercing < Integer > () {
2626 @ Override
27- public Object serialize (Object input ) {
27+ public Integer serialize (Object input ) {
2828 if (input instanceof String ) {
2929 return Integer .parseInt ((String ) input );
3030 } else if (input instanceof Integer ) {
31- return input ;
31+ return ( Integer ) input ;
3232 } else {
3333 return null ;
3434 }
3535 }
3636
3737 @ Override
38- public Object parseValue (Object input ) {
38+ public Integer parseValue (Object input ) {
3939 return serialize (input );
4040 }
4141
4242 @ Override
43- public Object parseLiteral (Object input ) {
43+ public Integer parseLiteral (Object input ) {
4444 if (!(input instanceof IntValue )) return null ;
4545 BigInteger value = ((IntValue ) input ).getValue ();
4646 if (value .compareTo (INT_MIN ) == -1 || value .compareTo (INT_MAX ) == 1 ) {
@@ -51,13 +51,13 @@ public Object parseLiteral(Object input) {
5151 });
5252
5353
54- public static GraphQLScalarType GraphQLLong = new GraphQLScalarType ("Long" , "Long type" , new Coercing () {
54+ public static GraphQLScalarType GraphQLLong = new GraphQLScalarType ("Long" , "Long type" , new Coercing < Long > () {
5555 @ Override
56- public Object serialize (Object input ) {
56+ public Long serialize (Object input ) {
5757 if (input instanceof String ) {
5858 return Long .parseLong ((String ) input );
5959 } else if (input instanceof Long ) {
60- return input ;
60+ return ( Long ) input ;
6161 } else if (input instanceof Integer ) {
6262 return ((Integer ) input ).longValue ();
6363 } else {
@@ -66,12 +66,12 @@ public Object serialize(Object input) {
6666 }
6767
6868 @ Override
69- public Object parseValue (Object input ) {
69+ public Long parseValue (Object input ) {
7070 return serialize (input );
7171 }
7272
7373 @ Override
74- public Object parseLiteral (Object input ) {
74+ public Long parseLiteral (Object input ) {
7575 if (input instanceof StringValue ) {
7676 return Long .parseLong (((StringValue ) input ).getValue ());
7777 } else if (input instanceof IntValue ) {
@@ -86,7 +86,7 @@ public Object parseLiteral(Object input) {
8686 }
8787 });
8888
89- public static GraphQLScalarType GraphQLFloat = new GraphQLScalarType ("Float" , "Built-in Float" , new Coercing () {
89+ public static GraphQLScalarType GraphQLFloat = new GraphQLScalarType ("Float" , "Built-in Float" , new Coercing < Double > () {
9090 @ Override
9191 public Double serialize (Object input ) {
9292 if (input instanceof String ) {
@@ -103,12 +103,12 @@ public Double serialize(Object input) {
103103 }
104104
105105 @ Override
106- public Object parseValue (Object input ) {
106+ public Double parseValue (Object input ) {
107107 return serialize (input );
108108 }
109109
110110 @ Override
111- public Object parseLiteral (Object input ) {
111+ public Double parseLiteral (Object input ) {
112112 if (input instanceof IntValue ) {
113113 return ((IntValue ) input ).getValue ().doubleValue ();
114114 } else if (input instanceof FloatValue ) {
@@ -119,30 +119,30 @@ public Object parseLiteral(Object input) {
119119 }
120120 });
121121
122- public static GraphQLScalarType GraphQLString = new GraphQLScalarType ("String" , "Built-in String" , new Coercing () {
122+ public static GraphQLScalarType GraphQLString = new GraphQLScalarType ("String" , "Built-in String" , new Coercing < String > () {
123123 @ Override
124- public Object serialize (Object input ) {
124+ public String serialize (Object input ) {
125125 return input == null ? null : input .toString ();
126126 }
127127
128128 @ Override
129- public Object parseValue (Object input ) {
129+ public String parseValue (Object input ) {
130130 return serialize (input );
131131 }
132132
133133 @ Override
134- public Object parseLiteral (Object input ) {
134+ public String parseLiteral (Object input ) {
135135 if (!(input instanceof StringValue )) return null ;
136136 return ((StringValue ) input ).getValue ();
137137 }
138138 });
139139
140140
141- public static GraphQLScalarType GraphQLBoolean = new GraphQLScalarType ("Boolean" , "Built-in Boolean" , new Coercing () {
141+ public static GraphQLScalarType GraphQLBoolean = new GraphQLScalarType ("Boolean" , "Built-in Boolean" , new Coercing < Boolean > () {
142142 @ Override
143- public Object serialize (Object input ) {
143+ public Boolean serialize (Object input ) {
144144 if (input instanceof Boolean ) {
145- return input ;
145+ return ( Boolean ) input ;
146146 } else if (input instanceof Integer ) {
147147 return (Integer ) input > 0 ;
148148 } else if (input instanceof String ) {
@@ -153,19 +153,19 @@ public Object serialize(Object input) {
153153 }
154154
155155 @ Override
156- public Object parseValue (Object input ) {
156+ public Boolean parseValue (Object input ) {
157157 return serialize (input );
158158 }
159159
160160 @ Override
161- public Object parseLiteral (Object input ) {
161+ public Boolean parseLiteral (Object input ) {
162162 if (!(input instanceof BooleanValue )) return null ;
163163 return ((BooleanValue ) input ).isValue ();
164164 }
165165 });
166166
167167
168- public static GraphQLScalarType GraphQLID = new GraphQLScalarType ("ID" , "Built-in ID" , new Coercing () {
168+ public static GraphQLScalarType GraphQLID = new GraphQLScalarType ("ID" , "Built-in ID" , new Coercing < Object > () {
169169 @ Override
170170 public Object serialize (Object input ) {
171171 if (input instanceof String ) {
@@ -195,7 +195,7 @@ public Object parseLiteral(Object input) {
195195 }
196196 });
197197
198- public static GraphQLScalarType GraphQLBigInteger = new GraphQLScalarType ("BigInteger" , "Built-in java.math.BigInteger" , new Coercing () {
198+ public static GraphQLScalarType GraphQLBigInteger = new GraphQLScalarType ("BigInteger" , "Built-in java.math.BigInteger" , new Coercing < BigInteger > () {
199199 @ Override
200200 public BigInteger serialize (Object input ) {
201201 if (input instanceof BigInteger ) {
@@ -227,7 +227,7 @@ public BigInteger parseLiteral(Object input) {
227227 }
228228 });
229229
230- public static GraphQLScalarType GraphQLBigDecimal = new GraphQLScalarType ("BigDecimal" , "Built-in java.math.BigDecimal" , new Coercing () {
230+ public static GraphQLScalarType GraphQLBigDecimal = new GraphQLScalarType ("BigDecimal" , "Built-in java.math.BigDecimal" , new Coercing < BigDecimal > () {
231231 @ Override
232232 public BigDecimal serialize (Object input ) {
233233 if (input instanceof BigDecimal ) {
@@ -265,7 +265,7 @@ public BigDecimal parseLiteral(Object input) {
265265 }
266266 });
267267
268- public static GraphQLScalarType GraphQLByte = new GraphQLScalarType ("Byte" , "Built-in Byte as Int" , new Coercing () {
268+ public static GraphQLScalarType GraphQLByte = new GraphQLScalarType ("Byte" , "Built-in Byte as Int" , new Coercing < Byte > () {
269269 @ Override
270270 public Byte serialize (Object input ) {
271271 if (input instanceof String ) {
@@ -293,7 +293,7 @@ public Byte parseLiteral(Object input) {
293293 }
294294 });
295295
296- public static GraphQLScalarType GraphQLShort = new GraphQLScalarType ("Short" , "Built-in Short as Int" , new Coercing () {
296+ public static GraphQLScalarType GraphQLShort = new GraphQLScalarType ("Short" , "Built-in Short as Int" , new Coercing < Short > () {
297297 @ Override
298298 public Short serialize (Object input ) {
299299 if (input instanceof String ) {
@@ -321,7 +321,7 @@ public Short parseLiteral(Object input) {
321321 }
322322 });
323323
324- public static GraphQLScalarType GraphQLChar = new GraphQLScalarType ("Char" , "Built-in Char as Character" , new Coercing () {
324+ public static GraphQLScalarType GraphQLChar = new GraphQLScalarType ("Char" , "Built-in Char as Character" , new Coercing < Character > () {
325325 @ Override
326326 public Character serialize (Object input ) {
327327 if (input instanceof String ) {
0 commit comments