public class TextAutoSuggestionRequest extends Request<java.util.List<AutoSuggest>>
Request
used to retrieve a List
of search terms by way of
Places search services.
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
or a bounding map viewport using
setMapViewport(GeoBoundingBox)
. Failing to set a map viewport will result in an
ErrorCode.INVALID_PARAMETER
when executing the request.
Modifier and Type | Class and Description |
---|---|
static class |
TextAutoSuggestionRequest.AutoSuggestFilterType
Represents values describing AutoSuggest response's result filter types that can be
used to filter the AutoSuggest response.
|
BUILDING_ID_REFERENCE_NAME, PLACE_CONTENT_WIKIPEDIA, PVID_ID_REFERENCE_NAME, VENUES_CONTENT_ID_REFERENCE_NAME, VENUES_DESTINATION_ID_REFERENCE_NAME, VENUES_ID_REFERENCE_NAME, VENUES_VENUE_ID_REFERENCE_NAME
Constructor and Description |
---|
TextAutoSuggestionRequest(java.lang.String partialTerm)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode |
execute(ResultListener<java.util.List<AutoSuggest>> listener)
Executes an asynchronous request.
|
int |
getCollectionSize()
Gets the current collection size being used for request responses.
|
RichTextFormatting |
getRichTextFormatting()
Gets the current
RichTextFormatting type being used in request responses. |
TextAutoSuggestionRequest |
setCollectionSize(int value)
Sets a collection size to be used for request responses.
|
TextAutoSuggestionRequest |
setFilters(java.util.EnumSet<TextAutoSuggestionRequest.AutoSuggestFilterType> filtersSet)
Set result type filter.
|
TextAutoSuggestionRequest |
setMapViewport(GeoBoundingBox mapViewport)
The map viewport is a bounding box of the map area currently visible to the user.
|
TextAutoSuggestionRequest |
setQueryText(java.lang.String partialTerm)
Set the query partial search term.
|
TextAutoSuggestionRequest |
setRichTextFormatting(RichTextFormatting value)
Sets a
RichTextFormatting to be used in request responses. |
TextAutoSuggestionRequest |
setSearchCenter(GeoCoordinate center)
Sets the search center.
|
public TextAutoSuggestionRequest(java.lang.String partialTerm)
Creates a request to return a list of suggested search terms that are related to a specified location context and a partial search term.
* A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
or a bounding map viewport using
setMapViewport(GeoBoundingBox)
. Failing to set a map viewport will result in
an ErrorCode.INVALID_PARAMETER
when executing the request.
partialTerm
- Partial term to be autocompleted. Should not be empty or null.public TextAutoSuggestionRequest setSearchCenter(GeoCoordinate center)
center
- The GeoCoordinate
representing the location context used to search for
nearby places.TextAutoSuggestionRequest
.public TextAutoSuggestionRequest setQueryText(java.lang.String partialTerm)
partialTerm
- A partial search term used to create a list of suggested search terms.TextAutoSuggestionRequest
.public TextAutoSuggestionRequest setFilters(java.util.EnumSet<TextAutoSuggestionRequest.AutoSuggestFilterType> filtersSet)
filtersSet
- A EnumSet
of
TextAutoSuggestionRequest.AutoSuggestFilterType
used to filter the AutoSuggestion response.TextAutoSuggestionRequest
.public RichTextFormatting getRichTextFormatting()
RichTextFormatting
type being used in request responses.RichTextFormatting
typepublic TextAutoSuggestionRequest setRichTextFormatting(RichTextFormatting value)
RichTextFormatting
to be used in request responses. The default formatting is
RichTextFormatting.HTML
.value
- Desired RichTextFormatting
Request
objectpublic int getCollectionSize()
public TextAutoSuggestionRequest setCollectionSize(int value)
value
- Desired response collection size per request.Request
objectpublic TextAutoSuggestionRequest setMapViewport(GeoBoundingBox mapViewport)
mapViewport
- The bounding box of the map area currently visible.TextAutoSuggestionRequest
object.public ErrorCode execute(ResultListener<java.util.List<AutoSuggest>> listener)
listener
- A ResultListener
passed along with the request to monitor progressErrorCode
representing an appropriate result