Class SimpleAutoSuggestDataSet

java.lang.Object
com.foreach.across.modules.entity.autosuggest.SimpleAutoSuggestDataSet
All Implemented Interfaces:
AutoSuggestDataSet

public class SimpleAutoSuggestDataSet extends Object implements 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:
  • Constructor Details

  • Method Details

    • suggestions

      public Object suggestions(String query, String controlName)
      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 interface AutoSuggestDataSet
      Parameters:
      query - usually the input of the user
      controlName - name of the control for which the suggestions are requested
      Returns:
      suggestions result
    • prefetch

      public Object prefetch(String controlName)
      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 interface AutoSuggestDataSet
      Parameters:
      controlName - name of the control for which the suggestions are requested
      Returns:
      suggestions result
    • isPrefetchSupported

      public boolean isPrefetchSupported()
      Specified by:
      isPrefetchSupported in interface AutoSuggestDataSet
      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