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>
    Finds a single item in the dataset based on the query.
    {DatasetInfo} about this provider
    the class type of the data for this provider
    The identifier used to access the dataset.
    default String
    Datasets namespacing prevents key collision between datasets and provides a way to group similar or associated datasets.
    item(V value)
    returns the item from the list with the matching 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 in the dataset
    io.reactivex.rxjava3.core.Observable<Map>
    list the values in the dataset in a common format of a name value pair.

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

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

    • getInfo

      DatasetInfo getInfo()
      {DatasetInfo} about this provider
      Returns:
      a DatasetInfo object
    • getKey

      String getKey()
      The identifier used to access the dataset. For example, the optionSource name for an {OptionType} or identifier for a Dataset or Options API request.
      Returns:
      the key identifier used to access the dataset
    • getNamespace

      default String getNamespace()
      Datasets namespacing prevents key collision between datasets and provides a way to group similar or associated datasets. A null namespace is for the global namespace
      Returns:
      the dataset namespace
    • 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 in the dataset
      Parameters:
      query - the user and map of query params or options to apply to the list
      Returns:
      a list of objects
    • find

      default io.reactivex.rxjava3.core.Maybe<T> find(DatasetQuery query)
      Finds a single item in the dataset based on the query. If the query returns multiple items, the first item is returned.
      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 in the dataset in a common format of a name value pair. (example: [[name: "blue", value: 1]])
      Parameters:
      query - a DatasetQuery containing 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 flexibility 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 item from the list with the matching 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 for the name/value pair list
    • itemValue

      V itemValue(T item)
      gets the value for an item
      Parameters:
      item - an item
      Returns:
      the corresponding value for the name/value pair list