1 package com.xtremelabs.robolectric.shadows; 2 3 import android.location.Address; 4 import com.xtremelabs.robolectric.internal.Implementation; 5 import com.xtremelabs.robolectric.internal.Implements; 6 7 8 @SuppressWarnings({"UnusedDeclaration"}) 9 @Implements(Address.class) 10 public class ShadowAddress { 11 private String addressLine1; 12 private String locality; 13 private String postalCode; 14 private String adminArea; 15 private String countryCode; 16 private double longitude; 17 private double latitude; 18 private boolean hasLatitude; 19 private boolean hasLongitude; 20 21 @Implementation getLatitude()22 public double getLatitude() { 23 return latitude; 24 } 25 26 @Implementation setLatitude(double latitude)27 public void setLatitude(double latitude) { 28 this.latitude = latitude; 29 } 30 31 @Implementation getLongitude()32 public double getLongitude() { 33 return longitude; 34 } 35 36 @Implementation setLongitude(double longitude)37 public void setLongitude(double longitude) { 38 this.longitude = longitude; 39 } 40 41 @Implementation setAddressLine(int index, String line)42 public void setAddressLine(int index, String line) { 43 addressLine1 = line; 44 } 45 46 @Implementation getAddressLine(int index)47 public String getAddressLine(int index) { 48 return addressLine1; 49 } 50 51 @Implementation setLocality(String locality)52 public void setLocality(String locality) { 53 this.locality = locality; 54 } 55 56 @Implementation getLocality()57 public String getLocality() { 58 return locality; 59 } 60 61 @Implementation getAdminArea()62 public String getAdminArea() { 63 return adminArea; 64 } 65 66 @Implementation setAdminArea(String adminArea)67 public void setAdminArea(String adminArea) { 68 this.adminArea = adminArea; 69 } 70 71 @Implementation getPostalCode()72 public String getPostalCode() { 73 return postalCode; 74 } 75 76 @Implementation setPostalCode(String postalCode)77 public void setPostalCode(String postalCode) { 78 this.postalCode = postalCode; 79 } 80 81 @Implementation getCountryCode()82 public String getCountryCode() { 83 return countryCode; 84 } 85 86 @Implementation setCountryCode(String countryCode)87 public void setCountryCode(String countryCode) { 88 this.countryCode = countryCode; 89 } 90 91 @Implementation hasLatitude()92 public boolean hasLatitude() { 93 return hasLatitude; 94 } 95 96 @Implementation hasLongitude()97 public boolean hasLongitude() { 98 return hasLongitude; 99 } 100 setSimulatedHasLatLong(boolean hasLatitude, boolean hasLongitude)101 public void setSimulatedHasLatLong(boolean hasLatitude, boolean hasLongitude) { 102 this.hasLatitude = hasLatitude; 103 this.hasLongitude = hasLongitude; 104 } 105 } 106