Interface KeyValueInstanceLoader

All Superinterfaces:
DataLoader
All Known Implementing Classes:
KeyValueInstanceLoaderImpl

@InstallSubject("loadDelegate") public interface KeyValueInstanceLoader extends DataLoader
Loads a single instance of KeyValueEntity.
  • Method Details

    • getContainer

      KeyValueContainer getContainer()
      Returns the container which accepts loaded entities.
      Specified by:
      getContainer in interface DataLoader
    • setContainer

      void setContainer(KeyValueContainer container)
      Sets the container which accepts loaded entities.
    • createLoadContext

      ValueLoadContext createLoadContext()
      Returns ValueLoadContext which is created by the parameters of this loader. The ValueLoadContext can be used with DataManager to load data by the same conditions.
    • getStoreName

      String getStoreName()
      Returns data store name.
    • setStoreName

      void setStoreName(String name)
      Sets the data store name. By default, the main data store is used.
    • getLoadDelegate

      Returns a function which will be used to load data instead of standard implementation.
    • setLoadDelegate

      void setLoadDelegate(Function<ValueLoadContext,KeyValueEntity> delegate)
      Sets a function which will be used to load data instead of standard implementation.
    • addPreLoadListener

      Adds a listener to KeyValueInstanceLoader.PreLoadEvent.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe(id = "fooDl", target = Target.DATA_LOADER)
           private void onFooDlPreLoad(KeyValueInstanceLoader.PreLoadEvent event) {
               // handle event here
           }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addPostLoadListener

      Adds a listener to KeyValueInstanceLoader.PostLoadEvent.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe(id = "fooDl", target = Target.DATA_LOADER)
           private void onFooDlPostLoad(KeyValueInstanceLoader.PostLoadEvent event) {
               // handle event here
           }
       
      Parameters:
      listener - listener
      Returns:
      subscription