com.hammurapi.store.local

## Class LocalStoreBase.Config<T,PK,S extends Store<T,PK,S>>

- java.lang.Object
- - com.hammurapi.store.local.LocalStoreBase.Config<T,PK,S>

- All Implemented Interfaces:
    Cloneable
  Enclosing class:
    LocalStoreBase<T,PK,S extends Store<T,PK,S>>

      public static class LocalStoreBase.Config<T,PK,S extends Store<T,PK,S>>
      extends Object
      implements Cloneable

  Store configuration.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalStoreBase.Config()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `long` | `getCleanupTaskThreshold()`
    `ExecutorService` | `getExecutorService()`
    `HandleFactory<T,PK,S,LocalHandle<T,PK,S>>` | `getHandleFactory()`
    `LocalHandle.HandleStrength` | `getHandleStrength()`
    `Collection<Store.Handle<T,PK,S>>` | `getNoPkStore()`
    `ObservableConverter<T>` | `getObservableConverter()`
    `Map<PK,Store.Handle<T,PK,S>>` | `getPkStore()`
    `Extractor<T,PK,S>` | `getPrimaryKeyExtractor()`
    `boolean` | `isCacheExtracted()`
    `boolean` | `isWeakPrimaryKey()`
    `void` | `setCacheExtracted(boolean cacheExtracted)`
    `void` | `setCleanupTaskThreshold(long cleanupTaskThreshold)`
    `void` | `setExecutorService(ExecutorService executorService)`
    `void` | `setHandleFactory(HandleFactory<T,PK,S,LocalHandle<T,PK,S>> handleFactory)`
    `void` | `setHandleStrength(LocalHandle.HandleStrength handleStrength)`
    `void` | `setNoPkStore(Collection<Store.Handle<T,PK,S>> noPkStore)`
    `void` | `setObservableConverter(ObservableConverter<T> observableConverter)`
    `void` | `setPkStore(Map<PK,Store.Handle<T,PK,S>> pkStore)`
    `void` | `setPrimaryKeyExtractor(Extractor<T,PK,S> primaryKeyExtractor)`
    `void` | `setWeakPrimaryKey(boolean weakPrimaryKey)`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalStoreBase.Config

          public LocalStoreBase.Config()

  - ### Method Detail

    - #### setCleanupTaskThreshold

          public void setCleanupTaskThreshold(long cleanupTaskThreshold)

      Parameters:
        `cleanupTaskThreshold` - When number of invalidated (removed) handles exceeds this threshold, the store performs cleanup of internal collections.

    - #### getCleanupTaskThreshold

          public long getCleanupTaskThreshold()

      Returns:
        Cleanup task threshold.

    - #### clone

          public Object clone()
                       throws CloneNotSupportedException

      Overrides:
        `clone` in class `Object`
      Throws:
        `CloneNotSupportedException`

    - #### getExecutorService

          public ExecutorService getExecutorService()

      Returns:
        Executor service. If null, all operations are performed in the caller thread.

    - #### setExecutorService

          public void setExecutorService(ExecutorService executorService)

      Parameters:
        `executorService` - Executor service. If null, all operations are performed in the caller thread.

    - #### getPrimaryKeyExtractor

          public Extractor<T,PK,S> getPrimaryKeyExtractor()

    - #### setPrimaryKeyExtractor

          public void setPrimaryKeyExtractor(Extractor<T,PK,S> primaryKeyExtractor)

      Parameters:
        `primaryKeyExtractor` - Primary key extractor. Can be null.

    - #### isCacheExtracted

          public boolean isCacheExtracted()

    - #### setCacheExtracted

          public void setCacheExtracted(boolean cacheExtracted)

      Parameters:
        `cacheExtracted` - If true, values extracted from stored objects are cached until object is updated through update() or put() methods. Default value is true.

    - #### getHandleStrength

          public LocalHandle.HandleStrength getHandleStrength()

    - #### setHandleStrength

          public void setHandleStrength(LocalHandle.HandleStrength handleStrength)

      Parameters:
        `handleStrength` - Handle strength. Default handle strength is HARD.

    - #### isWeakPrimaryKey

          public boolean isWeakPrimaryKey()

    - #### setWeakPrimaryKey

          public void setWeakPrimaryKey(boolean weakPrimaryKey)

      Parameters:
        `weakStore` - If true, the store uses WeakHashMap if primary key is set and pkStore is not set explicitly.

    - #### getPkStore

          public Map<PK,Store.Handle<T,PK,S>> getPkStore()

    - #### setPkStore

          public void setPkStore(Map<PK,Store.Handle<T,PK,S>> pkStore)

      Parameters:
        `pkStore` - Explicitly provided pkStore instance.

    - #### getNoPkStore

          public Collection<Store.Handle<T,PK,S>> getNoPkStore()

    - #### setNoPkStore

          public void setNoPkStore(Collection<Store.Handle<T,PK,S>> noPkStore)

      Parameters:
        `noPkStore` - Explicitly provided noPkStore instance.

    - #### setHandleFactory

          public void setHandleFactory(HandleFactory<T,PK,S,LocalHandle<T,PK,S>> handleFactory)

    - #### getHandleFactory

          public HandleFactory<T,PK,S,LocalHandle<T,PK,S>> getHandleFactory()

    - #### setObservableConverter

          public void setObservableConverter(ObservableConverter<T> observableConverter)

    - #### getObservableConverter

          public ObservableConverter<T> getObservableConverter()