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

    Fields 
    Modifier and Type Field Description
    java.lang.String component  
    java.lang.String value  
  • 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 ComponentFilter administrativeArea​(java.lang.String administrativeArea)
    Matches all the administrative area levels.
    static ComponentFilter country​(java.lang.String country)
    Matches a country name or a two letter ISO 3166-1 country code.
    static ComponentFilter locality​(java.lang.String locality)
    Matches against both locality and sublocality types.
    static ComponentFilter postalCode​(java.lang.String postalCode)
    Matches postal code or postal code prefix.
    static ComponentFilter route​(java.lang.String route)
    Matches long or short name of a route.
    java.lang.String toString()  
    java.lang.String toUrlValue()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • component

      public final java.lang.String component
    • value

      public final java.lang.String value
  • 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:
      toString in class java.lang.Object
    • toUrlValue

      public java.lang.String toUrlValue()
      Specified by:
      toUrlValue in interface StringJoin.UrlValue
      Returns:
      the object, represented as a URL value (not URL encoded).
    • route

      public static ComponentFilter route​(java.lang.String route)
      Matches long or short name of a route.
      Parameters:
      route - The name of the route to filter on.
      Returns:
      Returns a ComponentFilter.
    • locality

      public static ComponentFilter locality​(java.lang.String locality)
      Matches against both locality and sublocality types.
      Parameters:
      locality - The locality to filter on.
      Returns:
      Returns a ComponentFilter.
    • administrativeArea

      public static ComponentFilter administrativeArea​(java.lang.String administrativeArea)
      Matches all the administrative area levels.
      Parameters:
      administrativeArea - The administrative area to filter on.
      Returns:
      Returns a ComponentFilter.
    • postalCode

      public static ComponentFilter postalCode​(java.lang.String postalCode)
      Matches postal code or postal code prefix.
      Parameters:
      postalCode - The postal code to filter on.
      Returns:
      Returns a ComponentFilter.
    • country

      public static ComponentFilter country​(java.lang.String 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.