Class ComponentFilter

  • All Implemented Interfaces:
    com.google.maps.internal.StringJoin.UrlValue

    public class ComponentFilter
    extends java.lang.Object
    implements com.google.maps.internal.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.
    • Field Detail

      • component

        public final java.lang.String component
      • value

        public final java.lang.String value
    • Constructor Detail

      • 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 Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toUrlValue

        public java.lang.String toUrlValue()
        Specified by:
        toUrlValue in interface com.google.maps.internal.StringJoin.UrlValue
      • 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.