You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make the DataLoader to load the Key context in a type safe manner and in order to reuse the current infrastructure , I choose to extend the DataLoader :
public abstract class MyDataLoader<K, V, C> extends DataLoader<K, V> {
public MyDataLoader(){
super(newMappedBatchLoaderWithContext() , null);
}
public CompletableFuture<V> loadWithKeyContext(K key, C keyContext) {
return super.load(key, keyContext);
}
public abstract MappedBatchLoaderWithContext<K, V> newMappedBatchLoaderWithContext();
}
But the constructor DataLoader(Object batchLoadFunction, DataLoaderOptions options) in DataLoader are in the private scope now. Is it a good idea to make it be the protected scoped to provide more options for developers in case they want to customise their DataLoader?