Class ShadowGeocoder

    • Constructor Detail

      • ShadowGeocoder

        public ShadowGeocoder()
    • Method Detail

      • isPresent

        @Implementation
        protected static boolean isPresent()
        Returns:
        true by default, or the value specified via setIsPresent(boolean)
      • getFromLocation

        @Implementation
        protected List<Address> getFromLocation​(double latitude,
                                                double longitude,
                                                int maxResults)
                                         throws IOException
        Returns an empty list by default, or the last value set by setFromLocation(List)

        {@param latitude} and {@param longitude} are ignored by this implementation, except to check that they are in appropriate bounds. {@param maxResults} determines the maximum number of addresses to return.

        Throws:
        IOException
      • getFromLocation

        @Implementation(minSdk=33)
        protected void getFromLocation​(double latitude,
                                       double longitude,
                                       int maxResults,
                                       Geocoder.GeocodeListener listener)
                                throws IOException
        Sets an empty list by default, or the last value set by setFromLocation(List) in the provided listener

        latitude and longitude are ignored by this implementation, except to check that they are in appropriate bounds. maxResults determines the maximum number of addresses to return.

        Throws:
        IOException
      • setIsPresent

        public static void setIsPresent​(boolean value)
        Sets the value to be returned by Geocoder.isPresent().

        This value is reset to true for each test.

      • reset

        @Resetter
        public static void reset()