@@ -176,13 +176,13 @@ private GraphQL(GraphQLSchema graphQLSchema,
176176 Instrumentation instrumentation ,
177177 PreparsedDocumentProvider preparsedDocumentProvider ,
178178 ValueUnboxer valueUnboxer ) {
179- this .graphQLSchema = assertNotNull (graphQLSchema , "graphQLSchema must be non null" );
179+ this .graphQLSchema = assertNotNull (graphQLSchema , () -> "graphQLSchema must be non null" );
180180 this .queryStrategy = queryStrategy != null ? queryStrategy : new AsyncExecutionStrategy ();
181181 this .mutationStrategy = mutationStrategy != null ? mutationStrategy : new AsyncSerialExecutionStrategy ();
182182 this .subscriptionStrategy = subscriptionStrategy != null ? subscriptionStrategy : new SubscriptionExecutionStrategy ();
183- this .idProvider = assertNotNull (idProvider , "idProvider must be non null" );
183+ this .idProvider = assertNotNull (idProvider , () -> "idProvider must be non null" );
184184 this .instrumentation = assertNotNull (instrumentation );
185- this .preparsedDocumentProvider = assertNotNull (preparsedDocumentProvider , "preparsedDocumentProvider must be non null" );
185+ this .preparsedDocumentProvider = assertNotNull (preparsedDocumentProvider , () -> "preparsedDocumentProvider must be non null" );
186186 this .valueUnboxer = valueUnboxer ;
187187 }
188188
@@ -242,37 +242,37 @@ public Builder(GraphQLSchema graphQLSchema) {
242242 }
243243
244244 public Builder schema (GraphQLSchema graphQLSchema ) {
245- this .graphQLSchema = assertNotNull (graphQLSchema , "GraphQLSchema must be non null" );
245+ this .graphQLSchema = assertNotNull (graphQLSchema , () -> "GraphQLSchema must be non null" );
246246 return this ;
247247 }
248248
249249 public Builder queryExecutionStrategy (ExecutionStrategy executionStrategy ) {
250- this .queryExecutionStrategy = assertNotNull (executionStrategy , "Query ExecutionStrategy must be non null" );
250+ this .queryExecutionStrategy = assertNotNull (executionStrategy , () -> "Query ExecutionStrategy must be non null" );
251251 return this ;
252252 }
253253
254254 public Builder mutationExecutionStrategy (ExecutionStrategy executionStrategy ) {
255- this .mutationExecutionStrategy = assertNotNull (executionStrategy , "Mutation ExecutionStrategy must be non null" );
255+ this .mutationExecutionStrategy = assertNotNull (executionStrategy , () -> "Mutation ExecutionStrategy must be non null" );
256256 return this ;
257257 }
258258
259259 public Builder subscriptionExecutionStrategy (ExecutionStrategy executionStrategy ) {
260- this .subscriptionExecutionStrategy = assertNotNull (executionStrategy , "Subscription ExecutionStrategy must be non null" );
260+ this .subscriptionExecutionStrategy = assertNotNull (executionStrategy , () -> "Subscription ExecutionStrategy must be non null" );
261261 return this ;
262262 }
263263
264264 public Builder instrumentation (Instrumentation instrumentation ) {
265- this .instrumentation = assertNotNull (instrumentation , "Instrumentation must be non null" );
265+ this .instrumentation = assertNotNull (instrumentation , () -> "Instrumentation must be non null" );
266266 return this ;
267267 }
268268
269269 public Builder preparsedDocumentProvider (PreparsedDocumentProvider preparsedDocumentProvider ) {
270- this .preparsedDocumentProvider = assertNotNull (preparsedDocumentProvider , "PreparsedDocumentProvider must be non null" );
270+ this .preparsedDocumentProvider = assertNotNull (preparsedDocumentProvider , () -> "PreparsedDocumentProvider must be non null" );
271271 return this ;
272272 }
273273
274274 public Builder executionIdProvider (ExecutionIdProvider executionIdProvider ) {
275- this .idProvider = assertNotNull (executionIdProvider , "ExecutionIdProvider must be non null" );
275+ this .idProvider = assertNotNull (executionIdProvider , () -> "ExecutionIdProvider must be non null" );
276276 return this ;
277277 }
278278
@@ -299,9 +299,9 @@ public Builder valueUnboxer(ValueUnboxer valueUnboxer) {
299299 }
300300
301301 public GraphQL build () {
302- assertNotNull (graphQLSchema , "graphQLSchema must be non null" );
303- assertNotNull (queryExecutionStrategy , "queryStrategy must be non null" );
304- assertNotNull (idProvider , "idProvider must be non null" );
302+ assertNotNull (graphQLSchema , () -> "graphQLSchema must be non null" );
303+ assertNotNull (queryExecutionStrategy , () -> "queryStrategy must be non null" );
304+ assertNotNull (idProvider , () -> "idProvider must be non null" );
305305 final Instrumentation augmentedInstrumentation = checkInstrumentationDefaultState (instrumentation , doNotAddDefaultInstrumentations );
306306 return new GraphQL (graphQLSchema , queryExecutionStrategy , mutationExecutionStrategy , subscriptionExecutionStrategy , idProvider , augmentedInstrumentation , preparsedDocumentProvider , valueUnboxer );
307307 }
0 commit comments