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:
null
or an empty collection to indicate no results- a collection holding the objects that should be returned to the caller; usually converted to JSON
- a
ResponseEntity
that can already hold the JSON data
- Since:
- 3.0.0
- Author:
- Arne Vandamme
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represent a single auto-suggest result.static class
Nested classes/interfaces inherited from interface com.foreach.across.modules.entity.autosuggest.AutoSuggestDataSet
AutoSuggestDataSet.ResultTransformer
-
Constructor Summary
ConstructorDescriptionSimpleAutoSuggestDataSet
(BiFunction<String, String, Object> suggestionsLoader, Function<String, Object> prefetchLoader) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder for a simple dataset.boolean
Retrieve 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:
suggestions
in 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:
prefetch
in interfaceAutoSuggestDataSet
- Parameters:
controlName
- name of the control for which the suggestions are requested- Returns:
- suggestions result
-
isPrefetchSupported
public boolean isPrefetchSupported()- Specified by:
isPrefetchSupported
in interfaceAutoSuggestDataSet
- Returns:
- true if data from this set can be pre-fetched
-
builder
Description copied from interface:AutoSuggestDataSet
Create a builder for a simple dataset. Using a- Returns:
- builder for a simple auto-suggest dataset
-