Class DataLoaderFactory
- java.lang.Object
-
- org.dataloader.DataLoaderFactory
-
@PublicApi public class DataLoaderFactory extends java.lang.Object
A factory class to createDataLoader
s
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataLoaderFactory.Builder<K,V>
A builder ofDataLoader
s
-
Constructor Summary
Constructors Constructor Description DataLoaderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
DataLoaderFactory.Builder<K,V>builder()
Return a newDataLoaderFactory.Builder
of a data loader.static <K,V>
DataLoaderFactory.Builder<K,V>builder(DataLoader<K,V> dataLoader)
Return a newDataLoaderFactory.Builder
of a data loader using the specified one as a template.static <K,V>
DataLoader<K,V>newDataLoader(java.lang.String name, BatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newDataLoader(java.lang.String name, BatchLoader<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newDataLoader(java.lang.String name, BatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newDataLoader(BatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newDataLoader(BatchLoader<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newDataLoader(BatchLoaderWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newDataLoader(BatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newDataLoaderWithTry(java.lang.String name, BatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newDataLoaderWithTry(java.lang.String name, BatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newDataLoaderWithTry(BatchLoader<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newDataLoaderWithTry(BatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newDataLoaderWithTry(BatchLoaderWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newDataLoaderWithTry(BatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoader(java.lang.String name, MappedBatchLoader<K,V> batchLoadFunction, @Nullable DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedDataLoader(java.lang.String name, MappedBatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedDataLoader(MappedBatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newMappedDataLoader(MappedBatchLoader<K,V> batchLoadFunction, @Nullable DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedDataLoader(MappedBatchLoaderWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified mapped batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newMappedDataLoader(MappedBatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(java.lang.String name, MappedBatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(java.lang.String name, MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(MappedBatchLoader<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(MappedBatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedDataLoaderWithTry(MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(java.lang.String name, MappedBatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(java.lang.String name, MappedBatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(MappedBatchPublisher<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(MappedBatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(MappedBatchPublisherWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newMappedPublisherDataLoader(MappedBatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(java.lang.String name, MappedBatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(java.lang.String name, MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(MappedBatchPublisher<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(MappedBatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newMappedPublisherDataLoaderWithTry(MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoader(java.lang.String name, BatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newPublisherDataLoader(java.lang.String name, BatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newPublisherDataLoader(BatchPublisher<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newPublisherDataLoader(BatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newPublisherDataLoader(BatchPublisherWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).static <K,V>
DataLoader<K,V>newPublisherDataLoader(BatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided optionsstatic <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(java.lang.String name, BatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(java.lang.String name, BatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(BatchPublisher<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(BatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(BatchPublisherWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.static <K,V>
DataLoader<K,V>newPublisherDataLoaderWithTry(BatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.
-
-
-
Method Detail
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(BatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(java.lang.String name, BatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(BatchLoader<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(java.lang.String name, BatchLoader<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(BatchLoader<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(BatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(java.lang.String name, BatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(BatchLoaderWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(BatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newDataLoader
public static <K,V> DataLoader<K,V> newDataLoader(java.lang.String name, BatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(BatchLoaderWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(BatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newDataLoaderWithTry
public static <K,V> DataLoader<K,V> newDataLoaderWithTry(java.lang.String name, BatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(MappedBatchLoader<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(MappedBatchLoader<K,V> batchLoadFunction, @Nullable DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(java.lang.String name, MappedBatchLoader<K,V> batchLoadFunction, @Nullable DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(MappedBatchLoader<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(MappedBatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(java.lang.String name, MappedBatchLoader<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(MappedBatchLoaderWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified mapped batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(MappedBatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedDataLoader
public static <K,V> DataLoader<K,V> newMappedDataLoader(java.lang.String name, MappedBatchLoaderWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedDataLoaderWithTry(java.lang.String name, MappedBatchLoaderWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(BatchPublisher<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(BatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(java.lang.String name, BatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(BatchPublisher<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(BatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(java.lang.String name, BatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(BatchPublisherWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(BatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newPublisherDataLoader
public static <K,V> DataLoader<K,V> newPublisherDataLoader(java.lang.String name, BatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(BatchPublisherWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(BatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newPublisherDataLoaderWithTry(BatchPublisher)
-
newPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newPublisherDataLoaderWithTry(java.lang.String name, BatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newPublisherDataLoaderWithTry(BatchPublisher)
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(MappedBatchPublisher<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(MappedBatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(java.lang.String name, MappedBatchPublisher<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(MappedBatchPublisher<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(MappedBatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(java.lang.String name, MappedBatchPublisher<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newDataLoaderWithTry(BatchLoader)
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(MappedBatchPublisherWithContext<K,V> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size).- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(MappedBatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoader
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoader(java.lang.String name, MappedBatchPublisherWithContext<K,V> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function with the provided options- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to useoptions
- the options to use- Returns:
- a new DataLoader
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction)
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size) where the batch loader function returns a list ofTry
objects.If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then you can use this form to create the data loader.
Using Try objects allows you to capture a value returned or an exception that might have occurred trying to get a value. .
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objects- Returns:
- a new DataLoader
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
batchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newMappedPublisherDataLoaderWithTry(MappedBatchPublisher)
-
newMappedPublisherDataLoaderWithTry
public static <K,V> DataLoader<K,V> newMappedPublisherDataLoaderWithTry(java.lang.String name, MappedBatchPublisherWithContext<K,Try<V>> batchLoadFunction, DataLoaderOptions options)
Creates new DataLoader with the specified batch loader function and with the provided options where the batch loader function returns a list ofTry
objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name to usebatchLoadFunction
- the batch load function to use that usesTry
objectsoptions
- the options to use- Returns:
- a new DataLoader
- See Also:
newMappedPublisherDataLoaderWithTry(MappedBatchPublisher)
-
builder
public static <K,V> DataLoaderFactory.Builder<K,V> builder()
Return a newDataLoaderFactory.Builder
of a data loader.- Type Parameters:
K
- the key typeV
- the value type- Returns:
- a new
DataLoaderFactory.Builder
of a data loader
-
builder
public static <K,V> DataLoaderFactory.Builder<K,V> builder(DataLoader<K,V> dataLoader)
Return a newDataLoaderFactory.Builder
of a data loader using the specified one as a template.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
dataLoader
- theDataLoader
to copy values from into the builder- Returns:
- a new
DataLoaderFactory.Builder
of a data loader
-
-