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