@@ -205,7 +205,7 @@ for the context object.
205205
206206``` java
207207 DataLoaderOptions options = DataLoaderOptions . newOptions()
208- .setBatchLoaderContextProvider(() - > SecurityCtx . getCallingUserCtx());
208+ .setBatchLoaderContextProvider(() - > SecurityCtx . getCallingUserCtx()) . build( );
209209
210210 BatchLoaderWithContext<String , String > batchLoader = new BatchLoaderWithContext<String , String > () {
211211 @Override
@@ -227,7 +227,7 @@ You can gain access to them as a map by key or as the original list of context o
227227
228228``` java
229229 DataLoaderOptions options = DataLoaderOptions . newOptions()
230- .setBatchLoaderContextProvider(() - > SecurityCtx . getCallingUserCtx());
230+ .setBatchLoaderContextProvider(() - > SecurityCtx . getCallingUserCtx()) . build( );
231231
232232 BatchLoaderWithContext<String , String > batchLoader = new BatchLoaderWithContext<String , String > () {
233233 @Override
@@ -433,7 +433,7 @@ However, you can create your own custom future cache and supply it to the data l
433433
434434``` java
435435 MyCustomCache customCache = new MyCustomCache ();
436- DataLoaderOptions options = DataLoaderOptions . newOptions(). setCacheMap(customCache);
436+ DataLoaderOptions options = DataLoaderOptions . newOptions(). setCacheMap(customCache). build() ;
437437 DataLoaderFactory . newDataLoader(userBatchLoader, options);
438438```
439439
@@ -467,7 +467,7 @@ The tests have an example based on [Caffeine](https://github.com/ben-manes/caffe
467467In certain uncommon cases, a DataLoader which does not cache may be desirable.
468468
469469``` java
470- DataLoaderFactory . newDataLoader(userBatchLoader, DataLoaderOptions . newOptions(). setCachingEnabled(false ));
470+ DataLoaderFactory . newDataLoader(userBatchLoader, DataLoaderOptions . newOptions(). setCachingEnabled(false ). build() );
471471```
472472
473473Calling the above will ensure that every call to ` .load() ` will produce a new promise, and requested keys will not be saved in memory.
@@ -533,7 +533,7 @@ Knowing what the behaviour of your data is important for you to understand how e
533533You can configure the statistics collector used when you build the data loader
534534
535535``` java
536- DataLoaderOptions options = DataLoaderOptions . newOptions(). setStatisticsCollector(() - > new ThreadLocalStatisticsCollector ());
536+ DataLoaderOptions options = DataLoaderOptions . newOptions(). setStatisticsCollector(() - > new ThreadLocalStatisticsCollector ()). build() ;
537537 DataLoader<String ,User > userDataLoader = DataLoaderFactory . newDataLoader(userBatchLoader,options);
538538
539539```
@@ -780,7 +780,7 @@ You set the `DataLoaderInstrumentation` into the `DataLoaderOptions` at build ti
780780 });
781781 }
782782 };
783- DataLoaderOptions options = DataLoaderOptions . newOptions(). setInstrumentation(timingInstrumentation);
783+ DataLoaderOptions options = DataLoaderOptions . newOptions(). setInstrumentation(timingInstrumentation). build() ;
784784 DataLoader<String , User > userDataLoader = DataLoaderFactory . newDataLoader(userBatchLoader, options);
785785
786786```
0 commit comments