Package ai.nextbillion.maps.model
Class ComponentFilter
java.lang.Object
ai.nextbillion.maps.model.ComponentFilter
- All Implemented Interfaces:
StringJoin.UrlValue
public class ComponentFilter extends java.lang.Object implements StringJoin.UrlValue
A component filter for a geocode request. In a geocoding response, the Google Geocoding API can
return address results restricted to a specific area. The restriction is specified using the
components filter.
Please see Component Filtering for more detail.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ComponentFilter(java.lang.String component, java.lang.String value)Constructs a component filter. -
Method Summary
Modifier and Type Method Description static ComponentFilteradministrativeArea(java.lang.String administrativeArea)Matches all the administrative area levels.static ComponentFiltercountry(java.lang.String country)Matches a country name or a two letter ISO 3166-1 country code.static ComponentFilterlocality(java.lang.String locality)Matches against both locality and sublocality types.static ComponentFilterpostalCode(java.lang.String postalCode)Matches postal code or postal code prefix.static ComponentFilterroute(java.lang.String route)Matches long or short name of a route.java.lang.StringtoString()java.lang.StringtoUrlValue()
-
Field Details
-
Constructor Details
-
ComponentFilter
public ComponentFilter(java.lang.String component, java.lang.String value)Constructs a component filter.- Parameters:
component- The component to filter.value- The value of the filter.
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
toUrlValue
public java.lang.String toUrlValue()- Specified by:
toUrlValuein interfaceStringJoin.UrlValue- Returns:
- the object, represented as a URL value (not URL encoded).
-
route
Matches long or short name of a route.- Parameters:
route- The name of the route to filter on.- Returns:
- Returns a
ComponentFilter.
-
locality
Matches against both locality and sublocality types.- Parameters:
locality- The locality to filter on.- Returns:
- Returns a
ComponentFilter.
-
administrativeArea
Matches all the administrative area levels.- Parameters:
administrativeArea- The administrative area to filter on.- Returns:
- Returns a
ComponentFilter.
-
postalCode
Matches postal code or postal code prefix.- Parameters:
postalCode- The postal code to filter on.- Returns:
- Returns a
ComponentFilter.
-
country
Matches a country name or a two letter ISO 3166-1 country code.- Parameters:
country- The country to filter on.- Returns:
- Returns a
ComponentFilter.
-