Skip to content

Breaking change - renaming old mutable setXX methods #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ for the context object.

```java
DataLoaderOptions options = DataLoaderOptions.newOptions()
.setBatchLoaderContextProvider(() -> SecurityCtx.getCallingUserCtx());
.setBatchLoaderContextProvider(() -> SecurityCtx.getCallingUserCtx()).build();

BatchLoaderWithContext<String, String> batchLoader = new BatchLoaderWithContext<String, String>() {
@Override
Expand All @@ -227,7 +227,7 @@ You can gain access to them as a map by key or as the original list of context o

```java
DataLoaderOptions options = DataLoaderOptions.newOptions()
.setBatchLoaderContextProvider(() -> SecurityCtx.getCallingUserCtx());
.setBatchLoaderContextProvider(() -> SecurityCtx.getCallingUserCtx()).build();

BatchLoaderWithContext<String, String> batchLoader = new BatchLoaderWithContext<String, String>() {
@Override
Expand Down Expand Up @@ -433,7 +433,7 @@ However, you can create your own custom future cache and supply it to the data l

```java
MyCustomCache customCache = new MyCustomCache();
DataLoaderOptions options = DataLoaderOptions.newOptions().setCacheMap(customCache);
DataLoaderOptions options = DataLoaderOptions.newOptions().setCacheMap(customCache).build();
DataLoaderFactory.newDataLoader(userBatchLoader, options);
```

Expand Down Expand Up @@ -467,7 +467,7 @@ The tests have an example based on [Caffeine](https://github.com/ben-manes/caffe
In certain uncommon cases, a DataLoader which does not cache may be desirable.

```java
DataLoaderFactory.newDataLoader(userBatchLoader, DataLoaderOptions.newOptions().setCachingEnabled(false));
DataLoaderFactory.newDataLoader(userBatchLoader, DataLoaderOptions.newOptions().setCachingEnabled(false).build());
```

Calling the above will ensure that every call to `.load()` will produce a new promise, and requested keys will not be saved in memory.
Expand Down Expand Up @@ -533,7 +533,7 @@ Knowing what the behaviour of your data is important for you to understand how e
You can configure the statistics collector used when you build the data loader

```java
DataLoaderOptions options = DataLoaderOptions.newOptions().setStatisticsCollector(() -> new ThreadLocalStatisticsCollector());
DataLoaderOptions options = DataLoaderOptions.newOptions().setStatisticsCollector(() -> new ThreadLocalStatisticsCollector()).build();
DataLoader<String,User> userDataLoader = DataLoaderFactory.newDataLoader(userBatchLoader,options);

```
Expand Down Expand Up @@ -780,7 +780,7 @@ You set the `DataLoaderInstrumentation` into the `DataLoaderOptions` at build ti
});
}
};
DataLoaderOptions options = DataLoaderOptions.newOptions().setInstrumentation(timingInstrumentation);
DataLoaderOptions options = DataLoaderOptions.newOptions().setInstrumentation(timingInstrumentation).build();
DataLoader<String, User> userDataLoader = DataLoaderFactory.newDataLoader(userBatchLoader, options);

```
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dataloader/DataLoaderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public static <K, V> Builder<K, V> builder(DataLoader<K, V> dataLoader) {
*/
public static class Builder<K, V> {
Object batchLoadFunction;
DataLoaderOptions options = DataLoaderOptions.newOptions();
DataLoaderOptions options = DataLoaderOptions.newDefaultOptions();

Builder() {
}
Expand Down
Loading