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) Finds a single item in the dataset based on the query.getInfo()
{DatasetInfo
} about this providerthe class type of the data for this providergetKey()
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.returns the item from the list with the matching valuegets the name for an itemgets the value for an itemio.reactivex.rxjava3.core.Observable<T>
list
(DatasetQuery query) list the values in the datasetio.reactivex.rxjava3.core.Observable<Map>
listOptions
(DatasetQuery query) 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
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
the class type of the data for this provider- Returns:
- the class this provider operates on
-
list
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
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
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
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
returns the item from the list with the matching 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 for the name/value pair list
-
itemValue
gets the value for an item- Parameters:
item
- an item- Returns:
- the corresponding value for the name/value pair list
-