Interface DatasetProvider<T,V>

Type Parameters:
T - The Model class type for this dataset - or just basic types for fixed lists
V - The "value" or identifier type on the map of option items - usually a long or a string
All Superinterfaces:
PluginProvider
All Known Implementing Classes:
AbstractDatasetProvider

public interface DatasetProvider<T,V> extends PluginProvider
Provides support for defining custom data sets with option lookup or typeahead data
Since:
0.15.1
  • Method Summary

    Modifier and Type
    Method
    Description
    returns the matching item from the list with the value as a string or object - since option values are often stored or passed as strings or unknown types.
    default io.reactivex.rxjava3.core.Maybe<T>
    returns the matching item from the list with the value
    info about this provider
    the class type of the data for this provider
    the key of this dataset
    default String
    the namespace of the dataset.
    item(V value)
    returns the matching item from the list with the value
    itemName(T item)
    gets the name for an item
    itemValue(T item)
    gets the value for an item
    io.reactivex.rxjava3.core.Observable<T>
    list the values this provider provides
    io.reactivex.rxjava3.core.Observable<Map>
    list the values this provider provides

    Methods inherited from interface com.morpheusdata.core.providers.PluginProvider

    getCode, getMorpheus, getName, getPlugin, isPlugin
  • Method Details

    • getInfo

      DatasetInfo getInfo()
      info about this provider
      Returns:
      a map of info abount the provider
    • getKey

      String getKey()
      the key of this dataset
      Returns:
      the key identifier used to access the dataset
    • getNamespace

      default String getNamespace()
      the namespace of the dataset. Datasets are grouped by namespace so keys don't have to be globally unique and to group related datasets together a null namespace is for the global namespace
      Returns:
      the namespace for this dataset
    • getItemType

      Class<T> getItemType()
      the class type of the data for this provider
      Returns:
      the class this provider operates on
    • list

      io.reactivex.rxjava3.core.Observable<T> list(DatasetQuery query)
      list the values this provider provides
      Parameters:
      query - the user and map of query params or options to apply to the list
      Returns:
      a list of maps that have name value pairs of the items
    • find

      default io.reactivex.rxjava3.core.Maybe<T> find(DatasetQuery query)
      returns the matching item from the list with the value
      Parameters:
      query - the value to match the item in the list
      Returns:
      the
    • listOptions

      io.reactivex.rxjava3.core.Observable<Map> listOptions(DatasetQuery query)
      list the values this provider provides
      Parameters:
      query - the user and map of query params or options to apply to the list
      Returns:
      a list of maps that have name value pairs of the items
    • fetchItem

      T fetchItem(Object value)
      returns the matching item from the list with the value as a string or object - since option values are often stored or passed as strings or unknown types. lets the provider do its own conversions to call item with the proper type. did object for felxibility but probably is usually a string
      Parameters:
      value - the value to match the item in the list
      Returns:
      the item
    • item

      T item(V value)
      returns the matching item from the list with the value
      Parameters:
      value - the value to match the item in the list
      Returns:
      the
    • itemName

      String itemName(T item)
      gets the name for an item
      Parameters:
      item - an item
      Returns:
      the corresponding name that would be in the list
    • itemValue

      V itemValue(T item)
      gets the value for an item
      Parameters:
      item - an item
      Returns:
      the corresponding value that would be in the list