Package com.morpheusdata.core.providers
Interface DatasetProvider<T,V>
- Type Parameters:
T
- The Model class type for this dataset - or just basic types for fixed listsV
- 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
Provides support for defining custom data sets with option lookup or typeahead data
- Since:
- 0.15.1
-
Method Summary
Modifier and TypeMethodDescriptionreturns 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>
find
(DatasetQuery query) returns the matching item from the list with the valuegetInfo()
info about this providerthe class type of the data for this providergetKey()
the key of this datasetdefault String
the namespace of the dataset.returns the matching item from the list with the valuegets the name for an itemgets the value for an itemio.reactivex.rxjava3.core.Observable<T>
list
(DatasetQuery query) list the values this provider providesio.reactivex.rxjava3.core.Observable<Map>
listOptions
(DatasetQuery query) list the values this provider providesMethods 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
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
the class type of the data for this provider- Returns:
- the class this provider operates on
-
list
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
returns the matching item from the list with the value- Parameters:
query
- the value to match the item in the list- Returns:
- the
-
listOptions
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
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
returns the matching item from the list with the value- Parameters:
value
- the value to match the item in the list- Returns:
- the
-
itemName
gets the name for an item- Parameters:
item
- an item- Returns:
- the corresponding name that would be in the list
-
itemValue
gets the value for an item- Parameters:
item
- an item- Returns:
- the corresponding value that would be in the list
-