SearchNearbyRequest

public abstract class SearchNearbyRequest implements Request


Request used by searchNearby.

Summary

Nested types

public abstract class SearchNearbyRequest.Builder

Builder for SearchNearbyRequest.

How results will be ranked in the response.

Public constructors

Public methods

static SearchNearbyRequest.Builder
builder(
    LocationRestriction locationRestriction,
    List<Place.Field> placeFields
)

Returns a Builder.

abstract @Nullable CancellationToken

Returns the CancellationToken used by PlacesClient to cancel any queued requests.

abstract @Nullable List<String>

Returns the list of excluded primary place types.

abstract @Nullable List<String>

Returns the list of excluded place types.

abstract @Nullable List<String>

Returns the list of requested primary place types.

abstract @Nullable List<String>

Returns the list of requested place types.

abstract LocationRestriction

Returns the restricted region to search.

abstract @Nullable Integer

Returns the maximum number of results to return.

abstract List<Place.Field>

Returns the Fields that should be included in the place results.

abstract @Nullable SearchNearbyRequest.RankPreference

Returns the RankPreference.

abstract @Nullable String

The unicode country/region code (CLDR) of the location where the request is coming from.

static SearchNearbyRequest
newInstance(
    LocationRestriction locationRestriction,
    List<Place.Field> placeFields
)

Returns a SearchNearbyRequest.

Public constructors

SearchNearbyRequest

public SearchNearbyRequest()

Public methods

builder

public static SearchNearbyRequest.Builder builder(
    LocationRestriction locationRestriction,
    List<Place.Field> placeFields
)

Returns a Builder.

Parameters
LocationRestriction locationRestriction

The LocationRestriction means results outside the given location will not be returned.

List<Place.Field> placeFields

The Fields that should be included in the place results.

getCancellationToken

public abstract @Nullable CancellationToken getCancellationToken()

Returns the CancellationToken used by PlacesClient to cancel any queued requests.

getExcludedPrimaryTypes

public abstract @Nullable List<StringgetExcludedPrimaryTypes()

Returns the list of excluded primary place types.

There should not be any conflicting primary types, for example, a type should not appear in both the included primary types and excluded primary types.

See new Table A for the most up-to-date list of supported types available to searchNearby.

getExcludedTypes

public abstract @Nullable List<StringgetExcludedTypes()

Returns the list of excluded place types.

There should not be any conflicting types, for example, a type should not appear in both the included types and excluded types.

See new Table A for the most up-to-date list of supported types available to searchNearby.

getIncludedPrimaryTypes

public abstract @Nullable List<StringgetIncludedPrimaryTypes()

Returns the list of requested primary place types.

There should not be any conflicting primary types, for example, a type should not appear in both the included primary types and excluded primary types.

See new Table A for the most up-to-date list of supported types available to searchNearby.

getIncludedTypes

public abstract @Nullable List<StringgetIncludedTypes()

Returns the list of requested place types.

There should not be any conflicting types, for example, a type should not appear in both the included types and excluded types.

See new Table A for the most up-to-date list of supported types available to searchNearby.

getLocationRestriction

public abstract LocationRestriction getLocationRestriction()

Returns the restricted region to search.

This location serves as a restriction which means results outside the given location will not be returned.

The LocationRestriction for SearchNearbyRequest only supports CircularBounds type.

getMaxResultCount

public abstract @Nullable Integer getMaxResultCount()

Returns the maximum number of results to return. It must be between 1 and 20 (default), inclusively.

getPlaceFields

public abstract List<Place.FieldgetPlaceFields()

Returns the Fields that should be included in the place results.

getRankPreference

public abstract @Nullable SearchNearbyRequest.RankPreference getRankPreference()

Returns the RankPreference.

Default is POPULARITY.

getRegionCode

public abstract @Nullable String getRegionCode()

The unicode country/region code (CLDR) of the location where the request is coming from.

The region may affect the format and type of data returned.

See Territory Containment for region codes.

newInstance

public static SearchNearbyRequest newInstance(
    LocationRestriction locationRestriction,
    List<Place.Field> placeFields
)

Returns a SearchNearbyRequest.

Parameters
LocationRestriction locationRestriction

The LocationRestriction means results outside the given location will not be returned.

List<Place.Field> placeFields

The Fields that should be included in the place results.