2727 *
2828 * @since 1.0.0
2929 */
30- public class GeocoderAdapter extends BaseAdapter implements Filterable {
30+ class GeocoderAdapter extends BaseAdapter implements Filterable {
3131
3232 private final Context context ;
3333 private String baseUrl ;
@@ -39,14 +39,14 @@ public class GeocoderAdapter extends BaseAdapter implements Filterable {
3939 private double [] bbox ;
4040 private Position position ;
4141 private int limit ;
42- private String language ;
43- private Call call ;
42+ private String [] languages ;
43+ private Call < GeocodingResponse > call ;
4444
4545 private GeocoderFilter geocoderFilter ;
4646
4747 private List <CarmenFeature > features ;
4848
49- public GeocoderAdapter (Context context ) {
49+ GeocoderAdapter (Context context ) {
5050 this .context = context ;
5151 }
5252
@@ -60,7 +60,7 @@ public GeocoderAdapter(Context context) {
6060 * @return the base url used as endpoint.
6161 * @since 2.0.0
6262 */
63- public String getBaseUrl () {
63+ private String getBaseUrl () {
6464 return baseUrl ;
6565 }
6666
@@ -70,7 +70,7 @@ public String getBaseUrl() {
7070 * @param baseUrl base url used as end point
7171 * @since 2.0.0
7272 */
73- public void setBaseUrl (String baseUrl ) {
73+ void setBaseUrl (String baseUrl ) {
7474 this .baseUrl = baseUrl ;
7575 }
7676
@@ -81,7 +81,7 @@ public void setBaseUrl(String baseUrl) {
8181 * @see <a href="https://www.mapbox.com/help/define-access-token/">Mapbox access token</a>
8282 * @since 1.0.0
8383 */
84- public String getAccessToken () {
84+ private String getAccessToken () {
8585 return accessToken ;
8686 }
8787
@@ -104,7 +104,7 @@ public void setAccessToken(String accessToken) {
104104 * country code
105105 * @since 1.3.0
106106 */
107- public String getCountry () {
107+ private String getCountry () {
108108 return country ;
109109 }
110110
@@ -115,7 +115,7 @@ public String getCountry() {
115115 * @param country String matching country code.
116116 * @since 1.3.0
117117 */
118- public void setCountry (String country ) {
118+ void setCountry (String country ) {
119119 this .country = country ;
120120 }
121121
@@ -126,7 +126,7 @@ public void setCountry(String country) {
126126 * country code inside a String array.
127127 * @since 2.0.0
128128 */
129- public String [] getCountries () {
129+ private String [] getCountries () {
130130 return countries ;
131131 }
132132
@@ -138,7 +138,7 @@ public String[] getCountries() {
138138 * @param countries String array containing the country codes you want to limit results to.
139139 * @since 2.0.0
140140 */
141- public void setCountries (String [] countries ) {
141+ void setCountries (String [] countries ) {
142142 this .countries = countries ;
143143 }
144144
@@ -160,7 +160,7 @@ public String getType() {
160160 * @see <a href="https://www.mapbox.com/api-documentation/#request-format">Geocoding API documentation</a>
161161 * @since 2.0.0
162162 */
163- public String [] getTypes () {
163+ private String [] getTypes () {
164164 return types ;
165165 }
166166
@@ -184,7 +184,7 @@ public void setType(String type) {
184184 * @see <a href="https://www.mapbox.com/api-documentation/#request-format">Geocoding API documentation</a>
185185 * @since 2.0.0
186186 */
187- public void setTypes (String [] types ) {
187+ void setTypes (String [] types ) {
188188 this .types = types ;
189189 }
190190
@@ -194,22 +194,10 @@ public void setTypes(String[] types) {
194194 * @return double array containing minX, minY, maxX, maxY
195195 * @since 1.3.0
196196 */
197- public double [] getBbox () {
197+ private double [] getBbox () {
198198 return bbox ;
199199 }
200200
201- /**
202- * Bounding box within which to limit results.
203- *
204- * @param northeast The top right hand corner of your bounding box when the map is pointed north.
205- * @param southwest The bottom left hand corner of your bounding box when the map is pointed north.
206- * @since 1.3.0
207- */
208- public void setBbox (Position northeast , Position southwest ) {
209- setBbox (southwest .getLongitude (), southwest .getLatitude (),
210- northeast .getLongitude (), northeast .getLatitude ());
211- }
212-
213201 /**
214202 * Bounding box within which to limit results.
215203 *
@@ -219,7 +207,7 @@ public void setBbox(Position northeast, Position southwest) {
219207 * @param maxY Right of bounding box when map is pointed north.
220208 * @since 1.3.0
221209 */
222- public void setBbox (double minX , double minY , double maxX , double maxY ) {
210+ void setBbox (double minX , double minY , double maxX , double maxY ) {
223211 if (bbox == null ) {
224212 bbox = new double [4 ];
225213 }
@@ -236,7 +224,7 @@ public void setBbox(double minX, double minY, double maxX, double maxY) {
236224 * @see <a href="https://www.mapbox.com/api-documentation/#request-format">Geocoding API documentation</a>
237225 * @since 1.0.0
238226 */
239- public Position getProximity () {
227+ private Position getProximity () {
240228 return position ;
241229 }
242230
@@ -247,7 +235,7 @@ public Position getProximity() {
247235 * @see <a href="https://www.mapbox.com/api-documentation/#request-format">Geocoding API documentation</a>
248236 * @since 1.0.0
249237 */
250- public void setProximity (Position position ) {
238+ void setProximity (Position position ) {
251239 this .position = position ;
252240 }
253241
@@ -257,7 +245,7 @@ public void setProximity(Position position) {
257245 * @return integer value
258246 * @since 2.0.0
259247 */
260- public int getLimit () {
248+ private int getLimit () {
261249 return limit ;
262250 }
263251
@@ -267,16 +255,16 @@ public int getLimit() {
267255 * @param limit the integer value representing the amount of results desired.
268256 * @since 2.0.0
269257 */
270- public void setLimit (int limit ) {
258+ void setLimit (int limit ) {
271259 this .limit = limit ;
272260 }
273261
274262 /**
275263 * @return The locale in which results should be returned.
276264 * @since 2.0.0
277265 */
278- public String getLanguage () {
279- return language ;
266+ private String [] getLanguage () {
267+ return languages ;
280268 }
281269
282270 /**
@@ -293,11 +281,11 @@ public String getLanguage() {
293281 * <p>
294282 * This option is experimental.
295283 *
296- * @param language The locale in which results should be returned.
284+ * @param languages The locale in which results should be returned.
297285 * @since 2.0.0
298286 */
299- public void setLanguage (String language ) {
300- this .language = language ;
287+ void setLanguage (String ... languages ) {
288+ this .languages = languages ;
301289 }
302290
303291 /**
@@ -306,7 +294,7 @@ public void setLanguage(String language) {
306294 *
307295 * @since 2.0.0
308296 */
309- public void cancelApiCall () {
297+ void cancelApiCall () {
310298 if (call != null ) {
311299 call .cancel ();
312300 }
@@ -408,11 +396,11 @@ public Filter getFilter() {
408396
409397 private class GeocoderFilter extends Filter {
410398
411- private final MapboxGeocoding .Builder builder ;
399+ private final MapboxGeocoding .Builder < MapboxGeocoding . Builder > builder ;
412400
413- public GeocoderFilter () {
401+ GeocoderFilter () {
414402 super ();
415- builder = new MapboxGeocoding .Builder ();
403+ builder = new MapboxGeocoding .Builder <> ();
416404 }
417405
418406 @ Override
@@ -459,7 +447,7 @@ protected FilterResults performFiltering(CharSequence constraint) {
459447 builder .setLimit (limit );
460448 }
461449 if (getLanguage () != null ) {
462- builder .setLanguage ( language );
450+ builder .setLanguages ( languages );
463451 }
464452
465453 call = builder .build ().getCall ();
0 commit comments