@@ -39,7 +39,7 @@ public class ExtendedScalars {
39
39
* @see java.time.OffsetDateTime
40
40
* @see java.time.ZonedDateTime
41
41
*/
42
- public static GraphQLScalarType DateTime = new DateTimeScalar () ;
42
+ public static GraphQLScalarType DateTime = DateTimeScalar . INSTANCE ;
43
43
44
44
/**
45
45
* An RFC-3339 compliant date scalar that accepts string values like `1996-12-19` and produces
@@ -52,7 +52,7 @@ public class ExtendedScalars {
52
52
*
53
53
* @see java.time.LocalDate
54
54
*/
55
- public static GraphQLScalarType Date = new DateScalar () ;
55
+ public static GraphQLScalarType Date = DateScalar . INSTANCE ;
56
56
/**
57
57
* An RFC-3339 compliant time scalar that accepts string values like `6:39:57-08:00` and produces
58
58
* `java.time.OffsetTime` objects at runtime.
@@ -64,7 +64,7 @@ public class ExtendedScalars {
64
64
*
65
65
* @see java.time.OffsetTime
66
66
*/
67
- public static GraphQLScalarType Time = new TimeScalar () ;
67
+ public static GraphQLScalarType Time = TimeScalar . INSTANCE ;
68
68
69
69
/**
70
70
* An object scalar allows you to have a multi level data value without defining it in the graphql schema.
@@ -89,7 +89,7 @@ public class ExtendedScalars {
89
89
*
90
90
* @see #Json
91
91
*/
92
- public static GraphQLScalarType Object = new ObjectScalar () ;
92
+ public static GraphQLScalarType Object = ObjectScalar . INSTANCE ;
93
93
94
94
/**
95
95
* A synonym class for the {@link #Object} scalar, since some people prefer their SDL to look like the following :
@@ -106,68 +106,68 @@ public class ExtendedScalars {
106
106
*
107
107
* @see graphql.scalars.ExtendedScalars#Object
108
108
*/
109
- public static GraphQLScalarType Json = new JsonScalar () ;
109
+ public static GraphQLScalarType Json = JsonScalar . INSTANCE ;
110
110
111
111
/**
112
112
* A URL scalar that accepts URL strings and produces {@link java.net.URL} objects at runtime
113
113
*/
114
- public static GraphQLScalarType Url = new UrlScalar () ;
114
+ public static GraphQLScalarType Url = UrlScalar . INSTANCE ;
115
115
116
116
/**
117
117
* A Locale scalar that accepts a IETF BCP 47 language tag string and produces {@link
118
118
* java.util.Locale} objects at runtime.
119
119
*/
120
- public static GraphQLScalarType Locale = new LocaleScalar () ;
120
+ public static GraphQLScalarType Locale = LocaleScalar . INSTANCE ;
121
121
122
122
/**
123
123
* An `Int` scalar that MUST be greater than zero
124
124
*
125
125
* @see graphql.Scalars#GraphQLInt
126
126
*/
127
- public static GraphQLScalarType PositiveInt = new PositiveIntScalar () ;
127
+ public static GraphQLScalarType PositiveInt = PositiveIntScalar . INSTANCE ;
128
128
/**
129
129
* An `Int` scalar that MUST be less than zero
130
130
*
131
131
* @see graphql.Scalars#GraphQLInt
132
132
*/
133
- public static GraphQLScalarType NegativeInt = new NegativeIntScalar () ;
133
+ public static GraphQLScalarType NegativeInt = NegativeIntScalar . INSTANCE ;
134
134
/**
135
135
* An `Int` scalar that MUST be less than or equal to zero
136
136
*
137
137
* @see graphql.Scalars#GraphQLInt
138
138
*/
139
- public static GraphQLScalarType NonPositiveInt = new NonPositiveIntScalar () ;
139
+ public static GraphQLScalarType NonPositiveInt = NonPositiveIntScalar . INSTANCE ;
140
140
/**
141
141
* An `Int` scalar that MUST be greater than or equal to zero
142
142
*
143
143
* @see graphql.Scalars#GraphQLInt
144
144
*/
145
- public static GraphQLScalarType NonNegativeInt = new NonNegativeIntScalar () ;
145
+ public static GraphQLScalarType NonNegativeInt = NonNegativeIntScalar . INSTANCE ;
146
146
147
147
/**
148
148
* An `Float` scalar that MUST be greater than zero
149
149
*
150
150
* @see graphql.Scalars#GraphQLFloat
151
151
*/
152
- public static GraphQLScalarType PositiveFloat = new PositiveFloatScalar () ;
152
+ public static GraphQLScalarType PositiveFloat = PositiveFloatScalar . INSTANCE ;
153
153
/**
154
154
* An `Float` scalar that MUST be less than zero
155
155
*
156
156
* @see graphql.Scalars#GraphQLFloat
157
157
*/
158
- public static GraphQLScalarType NegativeFloat = new NegativeFloatScalar () ;
158
+ public static GraphQLScalarType NegativeFloat = NegativeFloatScalar . INSTANCE ;
159
159
/**
160
160
* An `Float` scalar that MUST be less than or equal to zero
161
161
*
162
162
* @see graphql.Scalars#GraphQLFloat
163
163
*/
164
- public static GraphQLScalarType NonPositiveFloat = new NonPositiveFloatScalar () ;
164
+ public static GraphQLScalarType NonPositiveFloat = NonPositiveFloatScalar . INSTANCE ;
165
165
/**
166
166
* An `Float` scalar that MUST be greater than or equal to zero
167
167
*
168
168
* @see graphql.Scalars#GraphQLFloat
169
169
*/
170
- public static GraphQLScalarType NonNegativeFloat = new NonNegativeFloatScalar () ;
170
+ public static GraphQLScalarType NonNegativeFloat = NonNegativeFloatScalar . INSTANCE ;
171
171
172
172
173
173
/**
@@ -177,6 +177,8 @@ public class ExtendedScalars {
177
177
* The scalar converts any passed in objects to Strings first and them matches it against the provided
178
178
* scalars to ensure its an acceptable value.
179
179
*
180
+ * @param name the name of the scalar
181
+ *
180
182
* @return a builder of a regex scalar
181
183
*/
182
184
public static RegexScalar .Builder newRegexScalar (String name ) {
@@ -188,7 +190,6 @@ public static RegexScalar.Builder newRegexScalar(String name) {
188
190
* <p>
189
191
* For example you may take a `String` scalar and alias it as `SocialMediaLink` if that helps introduce
190
192
* more semantic meaning to your type system.
191
- * <p>
192
193
* <pre>
193
194
* {@code
194
195
*
@@ -201,6 +202,8 @@ public static RegexScalar.Builder newRegexScalar(String name) {
201
202
* <p>
202
203
* A future version of the graphql specification may add this capability but in the meantime you can use this facility.
203
204
*
205
+ * @param name the name of the aliased scalar
206
+ *
204
207
* @return a builder of a aliased scalar
205
208
*/
206
209
public static AliasedScalar .Builder newAliasedScalar (String name ) {
0 commit comments