Class AutoSuggestDataEndpoint

java.lang.Object
com.foreach.across.modules.entity.autosuggest.AutoSuggestDataEndpoint

public final class AutoSuggestDataEndpoint extends Object
Registry for attaching a SimpleAutoSuggestDataSet to a particular endpoint. This usually makes the dataset callable over a remote API.
Since:
3.0.0
Author:
Arne Vandamme
See Also:
  • Constructor Details

    • AutoSuggestDataEndpoint

      public AutoSuggestDataEndpoint(String baseUrl)
  • Method Details

    • registerDataSet

      Deprecated.
      since 3.4.0 - manually specify an id
      Attach a dataset to this endpoint. This will assign a random unique name to this dataset, and make it available on the controller attached to this endpoint.
      Parameters:
      dataSet - to attach
      Returns:
      attached dataset context
    • registerDataSet

      public AutoSuggestDataEndpoint.MappedDataSet registerDataSet(@NonNull @NonNull String id, @NonNull @NonNull AutoSuggestDataSet dataSet)
      Attach a dataset with a specific id to this endpoint. Will replace any previously registered dataset for that endpoint.
      Parameters:
      id - of the dataset
      dataSet - to attach
      Returns:
      attached dataset context
    • removeDataSet

      public AutoSuggestDataSet removeDataSet(String id)
      Remove the dataset with that id.
      Parameters:
      id - of the dataset
      Returns:
      the underlying dataset that has been removed
    • getDataSet

      public AutoSuggestDataEndpoint.MappedDataSet getDataSet(String dataSetId)
      Get the dataset with that id.
      Parameters:
      dataSetId - id of the dataset
      Returns:
      dataset of null if not found
    • suggestionsUriComponents

      public org.springframework.web.util.UriComponentsBuilder suggestionsUriComponents(String dataSetId)
      Create the suggestions url components for a named dataset. Usually the resulting url should not be encoded as it contains {{XX}} parameters.
      Parameters:
      dataSetId - id of the dataset
      Returns:
      url
    • prefetchUriComponents

      public org.springframework.web.util.UriComponentsBuilder prefetchUriComponents(String dataSetId)
      Create the prefetch url components for a named dataset. Usually the resulting url should not be encoded as it contains {{XX}} parameters.
      Parameters:
      dataSetId - id of the dataset
      Returns:
      url