Class SimpleAutoSuggestDataSet
java.lang.Object
com.foreach.across.modules.entity.autosuggest.SimpleAutoSuggestDataSet
- All Implemented Interfaces:
AutoSuggestDataSet
Represents a simple dataset used for auto-suggest data.
A dataset has a function for suggestions based on a query, and one to prefetch suggestion data.
The return value of the functions is a general object which will usually be converted
to a specific output format by a controller. Usually the return value is one of the following:
nullor an empty collection to indicate no results- a collection holding the objects that should be returned to the caller; usually converted to JSON
- a
ResponseEntitythat can already hold the JSON data
- Since:
- 3.0.0
- Author:
- Arne Vandamme
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresent a single auto-suggest result.static classNested classes/interfaces inherited from interface com.foreach.across.modules.entity.autosuggest.AutoSuggestDataSet
AutoSuggestDataSet.ResultTransformer -
Constructor Summary
ConstructorsConstructorDescriptionSimpleAutoSuggestDataSet(BiFunction<String, String, Object> suggestionsLoader, Function<String, Object> prefetchLoader) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder for a simple dataset.booleanRetrieve the prefetch data for this set.suggestions(String query, String controlName) Retrieve the suggestions for a particular query.
-
Constructor Details
-
SimpleAutoSuggestDataSet
-
-
Method Details
-
suggestions
Retrieve the suggestions for a particular query. The second parameter is an optional control name for which the suggestions are requested.- Specified by:
suggestionsin interfaceAutoSuggestDataSet- Parameters:
query- usually the input of the usercontrolName- name of the control for which the suggestions are requested- Returns:
- suggestions result
-
prefetch
Retrieve the prefetch data for this set. Prefetch data is the initial data that should be loaded and possibly shown as suggestions, without the user having entered a particular query string.- Specified by:
prefetchin interfaceAutoSuggestDataSet- Parameters:
controlName- name of the control for which the suggestions are requested- Returns:
- suggestions result
-
isPrefetchSupported
public boolean isPrefetchSupported()- Specified by:
isPrefetchSupportedin interfaceAutoSuggestDataSet- Returns:
- true if data from this set can be pre-fetched
-
builder
Description copied from interface:AutoSuggestDataSetCreate a builder for a simple dataset. Using a- Returns:
- builder for a simple auto-suggest dataset
-