Class DataLoaderOptions.Builder

java.lang.Object
org.dataloader.DataLoaderOptions.Builder
Enclosing class:
DataLoaderOptions

public static class DataLoaderOptions.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setBatchingEnabled

      public DataLoaderOptions.Builder setBatchingEnabled(boolean batchingEnabled)
      Sets the option that determines whether batch loading is enabled.
      Parameters:
      batchingEnabled - true to enable batch loading, false otherwise
      Returns:
      this builder for fluent coding
    • setCachingEnabled

      public DataLoaderOptions.Builder setCachingEnabled(boolean cachingEnabled)
      Sets the option that determines whether caching is enabled.
      Parameters:
      cachingEnabled - true to enable caching, false otherwise
      Returns:
      this builder for fluent coding
    • setCachingExceptionsEnabled

      public DataLoaderOptions.Builder setCachingExceptionsEnabled(boolean cachingExceptionsEnabled)
      Sets the option that determines whether exceptional values are cache enabled.
      Parameters:
      cachingExceptionsEnabled - true to enable caching exceptional values, false otherwise
      Returns:
      this builder for fluent coding
    • setCacheKeyFunction

      public DataLoaderOptions.Builder setCacheKeyFunction(CacheKey<?> cacheKeyFunction)
      Sets the function to use for creating the cache key, if caching is enabled.
      Parameters:
      cacheKeyFunction - the cache key function to use
      Returns:
      this builder for fluent coding
    • setCacheMap

      public DataLoaderOptions.Builder setCacheMap(CacheMap<?,?> cacheMap)
      Sets the cache map implementation to use for caching, if caching is enabled.
      Parameters:
      cacheMap - the cache map instance
      Returns:
      this builder for fluent coding
    • setValueCache

      public DataLoaderOptions.Builder setValueCache(ValueCache<?,?> valueCache)
      Sets the value cache implementation to use for caching values, if caching is enabled.
      Parameters:
      valueCache - the value cache instance
      Returns:
      this builder for fluent coding
    • setMaxBatchSize

      public DataLoaderOptions.Builder setMaxBatchSize(int maxBatchSize)
      Sets the maximum number of keys that will be presented to the BatchLoader function before they are split into multiple class
      Parameters:
      maxBatchSize - the maximum batch size
      Returns:
      this builder for fluent coding
    • setStatisticsCollector

      public DataLoaderOptions.Builder setStatisticsCollector(Supplier<StatisticsCollector> statisticsCollector)
      Sets the statistics collector supplier that will be used with these data loader options. Since it uses the supplier pattern, you can create a new statistics collector on each call, or you can reuse a common value
      Parameters:
      statisticsCollector - the statistics collector to use
      Returns:
      this builder for fluent coding
    • setBatchLoaderContextProvider

      public DataLoaderOptions.Builder setBatchLoaderContextProvider(BatchLoaderContextProvider environmentProvider)
      Sets the batch loader environment provider that will be used to give context to batch load functions
      Parameters:
      environmentProvider - the batch loader context provider
      Returns:
      this builder for fluent coding
    • setValueCacheOptions

      public DataLoaderOptions.Builder setValueCacheOptions(ValueCacheOptions valueCacheOptions)
      Sets the ValueCacheOptions that control how the ValueCache will be used
      Parameters:
      valueCacheOptions - the value cache options
      Returns:
      this builder for fluent coding
    • setBatchLoaderScheduler

      public DataLoaderOptions.Builder setBatchLoaderScheduler(BatchLoaderScheduler batchLoaderScheduler)
      Sets in a new BatchLoaderScheduler that allows the call to a BatchLoader function to be scheduled to some future time.
      Parameters:
      batchLoaderScheduler - the scheduler
      Returns:
      this builder for fluent coding
    • setInstrumentation

      public DataLoaderOptions.Builder setInstrumentation(DataLoaderInstrumentation instrumentation)
      Parameters:
      instrumentation - the new DataLoaderInstrumentation
      Returns:
      this builder for fluent coding
    • build

      public DataLoaderOptions build()