public class PlacesQuery extends AbstractQuery
Modifier and Type | Class and Description |
---|---|
static class |
PlacesQuery.Type
Types of places that can be searched for.
|
AbstractQuery.LatLng
Modifier and Type | Field and Description |
---|---|
static int |
RADIUS_ALL |
Constructor and Description |
---|
PlacesQuery()
Construct an empty query.
|
PlacesQuery(CharSequence query)
Construct a query with the specified full text query.
|
PlacesQuery(PlacesQuery other)
Clone an existing query.
|
Modifier and Type | Method and Description |
---|---|
AbstractQuery.LatLng |
getAroundLatLng() |
Boolean |
getAroundLatLngViaIP() |
Integer |
getAroundRadius()
Get the current radius for around latitude/longitude queries.
|
String[] |
getCountries() |
String |
getHighlightPostTag() |
String |
getHighlightPreTag() |
Integer |
getHitsPerPage() |
String |
getLanguage() |
String |
getQuery() |
PlacesQuery.Type |
getType() |
PlacesQuery |
set(String name,
Object value)
Set a parameter in an untyped fashion.
|
PlacesQuery |
setAroundLatLng(AbstractQuery.LatLng location)
Force to *first* search around a specific latitude/longitude.
|
PlacesQuery |
setAroundLatLngViaIP(Boolean enabled)
Search *first* around the geolocation of the user found via his IP address.
|
PlacesQuery |
setAroundRadius(Integer radius)
Change the radius for around latitude/longitude queries.
|
PlacesQuery |
setCountries(String... countries)
Restrict the search results to a specific list of countries.
|
PlacesQuery |
setHighlightPostTag(String tag) |
PlacesQuery |
setHighlightPreTag(String tag) |
PlacesQuery |
setHitsPerPage(Integer nbHitsPerPage)
Set how many results you want to retrieve per search.
|
PlacesQuery |
setLanguage(String language)
Restrict the search results to a single language.
|
PlacesQuery |
setQuery(CharSequence query)
Set the full text query.
|
PlacesQuery |
setType(PlacesQuery.Type type)
Set the type of place to search for.
|
build, equals, get, hashCode, parseFrom, parseLatLng, toString
public static final int RADIUS_ALL
public PlacesQuery()
public PlacesQuery(CharSequence query)
query
- Full text query.public PlacesQuery(@NonNull PlacesQuery other)
other
- The query to be cloned.@NonNull public PlacesQuery setQuery(CharSequence query)
public String getQuery()
@NonNull public PlacesQuery setAroundLatLng(AbstractQuery.LatLng location)
location
- The location to start the search at, or `null` to use the default.public AbstractQuery.LatLng getAroundLatLng()
@NonNull public PlacesQuery setAroundLatLngViaIP(Boolean enabled)
enabled
- Whether to use IP address to determine geolocation, or `null` to use the default.public Boolean getAroundLatLngViaIP()
@NonNull public PlacesQuery setAroundRadius(Integer radius)
radius
- The radius to set, or RADIUS_ALL
to disable stopping at a specific radius, or `null` to
use the default.public Integer getAroundRadius()
@NonNull public PlacesQuery setHighlightPostTag(String tag)
public String getHighlightPostTag()
@NonNull public PlacesQuery setHighlightPreTag(String tag)
public String getHighlightPreTag()
@NonNull public PlacesQuery setHitsPerPage(Integer nbHitsPerPage)
public Integer getHitsPerPage()
@NonNull public PlacesQuery setType(PlacesQuery.Type type)
type
- Type of place to search for.public PlacesQuery.Type getType()
@NonNull public PlacesQuery setLanguage(String language)
language
- The language used to return the results, or `null` to use all available languages.public String getLanguage()
@NonNull public PlacesQuery setCountries(String... countries)
Default: Search on the whole planet.
countries
- The countries to restrict the search to, or `null` to search on the whole planet.public String[] getCountries()
@NonNull public PlacesQuery set(@NonNull String name, @Nullable Object value)
set
in class AbstractQuery
name
- The parameter's name.value
- The parameter's value, or null to remove it.
It will first be converted to a String by the `toString()` method.