Package org.robolectric.shadows
Class ShadowGeocoder
java.lang.Object
org.robolectric.shadows.ShadowGeocoder
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetFromLocation(double latitude, double longitude, int maxResults) Returns an empty list by default, or the last value set bysetFromLocation(List)protected voidgetFromLocation(double latitude, double longitude, int maxResults, Geocoder.GeocodeListener listener) Sets an empty list by default, or the last value set bysetFromLocation(List)in the providedlistenerprotected voidgetFromLocationName(String locationName, int maxResults, Geocoder.GeocodeListener listener) Sets an empty list by default, or the last value set bysetFromLocation(List)in the providedlistenerprotected static booleanstatic voidreset()voidsetErrorMessage(String message) Sets the value to be passed toGeocoder.GeocodeListener.onError(String).voidsetFromLocation(List<Address> list) Sets the value to be returned byGeocoder.getFromLocation(double, double, int).static voidsetIsPresent(boolean value) Sets the value to be returned byGeocoder.isPresent().
- 
Constructor Details- 
ShadowGeocoderpublic ShadowGeocoder()
 
- 
- 
Method Details- 
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 bysetFromLocation(List)and are ignored by this implementation, except to check that they are in appropriate bounds. 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 bysetFromLocation(List)in the providedlistenerlatitudeandlongitudeare ignored by this implementation, except to check that they are in appropriate bounds.maxResultsdetermines the maximum number of addresses to return.- Throws:
- IOException
 
- 
getFromLocationName@Implementation(minSdk=33) protected void getFromLocationName(String locationName, int maxResults, Geocoder.GeocodeListener listener) Sets an empty list by default, or the last value set bysetFromLocation(List)in the providedlistenerlocationNameis ignored by this implementation.maxResultsdetermines the maximum number of addresses to return.
- 
setIsPresentpublic static void setIsPresent(boolean value) Sets the value to be returned byGeocoder.isPresent().This value is reset to true for each test. 
- 
setFromLocationSets the value to be returned byGeocoder.getFromLocation(double, double, int).
- 
setErrorMessageSets the value to be passed toGeocoder.GeocodeListener.onError(String).
- 
reset
 
-