From ff6dfd51212f7c34d9053006a9a60848532616ef Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Mon, 9 Jan 2017 10:14:17 -0500 Subject: [PATCH] remove deprecated v4 directions --- mapbox/app/src/main/AndroidManifest.xml | 5 - .../android/testapp/MainActivity.java | 6 +- .../directions/DirectionsV4Activity.java | 191 -------- .../res/layout/activity_directions_v4.xml | 26 - .../main/res/layout/content_directions_v4.xml | 16 - .../api/directions/v4/DirectionsCriteria.java | 146 ------ .../api/directions/v4/DirectionsService.java | 45 -- .../api/directions/v4/MapboxDirections.java | 461 ------------------ .../v4/models/DirectionsFeature.java | 82 ---- .../v4/models/DirectionsResponse.java | 117 ----- .../directions/v4/models/DirectionsRoute.java | 150 ------ .../directions/v4/models/FeatureGeometry.java | 74 --- .../v4/models/FeatureProperties.java | 35 -- .../directions/v4/models/ManeuverPoint.java | 75 --- .../api/directions/v4/models/RouteStep.java | 155 ------ .../directions/v4/models/StepManeuver.java | 113 ----- .../api/directions/v4/models/Waypoint.java | 72 --- .../directions/v4/models/package-info.java | 6 - .../api/directions/v4/package-info.java | 6 - 19 files changed, 2 insertions(+), 1779 deletions(-) delete mode 100644 mapbox/app/src/main/java/com/mapbox/services/android/testapp/directions/DirectionsV4Activity.java delete mode 100644 mapbox/app/src/main/res/layout/activity_directions_v4.xml delete mode 100644 mapbox/app/src/main/res/layout/content_directions_v4.xml delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsCriteria.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsService.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/MapboxDirections.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsFeature.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsResponse.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsRoute.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureGeometry.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureProperties.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/ManeuverPoint.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/RouteStep.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/StepManeuver.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/Waypoint.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/package-info.java delete mode 100644 mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/package-info.java diff --git a/mapbox/app/src/main/AndroidManifest.xml b/mapbox/app/src/main/AndroidManifest.xml index 3a2e5f029..3a50521e2 100644 --- a/mapbox/app/src/main/AndroidManifest.xml +++ b/mapbox/app/src/main/AndroidManifest.xml @@ -26,11 +26,6 @@ - () { - @Override - public void onResponse(Call call, Response response) { - // You can get generic HTTP info about the response - Log.d(LOG_TAG, "Response code: " + response.code()); - if (response.body() == null) { - Log.e(LOG_TAG, "No routes found, make sure you set the right user and access token."); - return; - } - - // Print some info about the route - currentRoute = response.body().getRoutes().get(0); - Log.d(LOG_TAG, "Distance: " + currentRoute.getDistance()); - showMessage(String.format("Route is %d meters long.", currentRoute.getDistance())); - - // Draw the route on the map - drawRoute(currentRoute); - } - - @Override - public void onFailure(Call call, Throwable throwable) { - Log.e(LOG_TAG, "Error: " + throwable.getMessage()); - showMessage("Error: " + throwable.getMessage()); - } - }); - } - - private void drawRoute(DirectionsRoute route) { - // Convert LineString coordinates into LatLng[] - LineString lineString = route.asLineString(Constants.OSRM_PRECISION_V4); - List coordinates = lineString.getCoordinates(); - LatLng[] points = new LatLng[coordinates.size()]; - for (int i = 0; i < coordinates.size(); i++) { - points[i] = new LatLng( - coordinates.get(i).getLatitude(), - coordinates.get(i).getLongitude()); - } - - // Draw Points on MapView - mapboxMap.addPolyline(new PolylineOptions() - .add(points) - .color(Color.parseColor("#3887be")) - .width(5)); - } - - private void showMessage(String message) { - Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); - } - - @Override - public void onResume() { - super.onResume(); - mapView.onResume(); - } - - @Override - public void onPause() { - super.onPause(); - mapView.onPause(); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - public void onLowMemory() { - super.onLowMemory(); - mapView.onLowMemory(); - } - -} diff --git a/mapbox/app/src/main/res/layout/activity_directions_v4.xml b/mapbox/app/src/main/res/layout/activity_directions_v4.xml deleted file mode 100644 index 54101ce90..000000000 --- a/mapbox/app/src/main/res/layout/activity_directions_v4.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/mapbox/app/src/main/res/layout/content_directions_v4.xml b/mapbox/app/src/main/res/layout/content_directions_v4.xml deleted file mode 100644 index 88e9ec0ba..000000000 --- a/mapbox/app/src/main/res/layout/content_directions_v4.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsCriteria.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsCriteria.java deleted file mode 100644 index 7b83d05f4..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsCriteria.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.mapbox.services.api.directions.v4; - -/** - * Constants used to customize the directions request. These constansts are shared by the - * {@link com.mapbox.services.api.mapmatching.v4.MapboxMapMatching} object. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public final class DirectionsCriteria { - - /** - * For car and motorcycle routing. This profile shows the fastest routes by preferring - * high-speed roads like highways. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String PROFILE_DRIVING = "mapbox.driving"; - - /** - * For pedestrian and hiking routing. This profile shows the shortest path by using sidewalks - * and trails. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String PROFILE_WALKING = "mapbox.walking"; - - /** - * For bicycle routing. This profile shows routes that are short and safe for cyclist, avoiding - * highways and preferring streets with bike lanes. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String PROFILE_CYCLING = "mapbox.cycling"; - - /** - * Format to return route instructions will be text. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String INSTRUCTIONS_TEXT = "text"; - - /** - * Format to return route instructions will be html. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String INSTRUCTIONS_HTML = "html"; - - /** - * Format to return route geometry will be geojson. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String GEOMETRY_GEOJSON = "geojson"; - - /** - * Format to return route geometry will be encoded polyline. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String GEOMETRY_POLYLINE = "polyline"; - - /** - * Use false to omit geometry from response. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String GEOMETRY_FALSE = "false"; - - /** - * Normal case - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String RESPONSE_OK = "Ok"; - - /** - * The input did not produce any matches. Features will be an empty array. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String RESPONSE_NO_MATCH = "NoMatch"; - - /** - * There are more than 100 points in the request. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String RESPONSE_TOO_MANY_COORDINATES = "TooManyCoordinates"; - - /** - * message will hold an explanation of the invalid input. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String RESPONSE_INVALID_INPUT = "InvalidInput"; - - /** - * Profile should be mapbox.driving, mapbox.walking, or mapbox.cycling. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead or if MapMatching use - * {@link com.mapbox.services.api.mapmatching.v4.MapMatchingCriteria} - */ - @Deprecated - public static final String RESPONSE_PROFILE_NOT_FOUND = "ProfileNotFound"; - -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsService.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsService.java deleted file mode 100644 index 96ff2e411..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/DirectionsService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.mapbox.services.api.directions.v4; - -import com.mapbox.services.api.directions.v4.models.DirectionsResponse; - -import retrofit2.Call; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Path; -import retrofit2.http.Query; - -/** - * Interface that defines the directions service (v4). - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public interface DirectionsService { - - /** - * Call-based interface - * - * @param userAgent The user. - * @param profile The profile directions should use. - * @param waypoints The waypoints the route should follow. - * @param accessToken Mapbox access token. - * @param alternatives Define whether you want to recieve more then one route. - * @param instructions Define if you'd like to recieve route instructions. - * @param geometry Route geometry. - * @param steps Define if you'd like the route steps. - * @return A retrofit Call object - * @since 1.0.0 - */ - @GET("v4/directions/{profile}/{waypoints}.json") - Call getCall( - @Header("User-Agent") String userAgent, - @Path("profile") String profile, - @Path("waypoints") String waypoints, - @Query("access_token") String accessToken, - @Query("alternatives") Boolean alternatives, - @Query("instructions") String instructions, - @Query("geometry") String geometry, - @Query("steps") Boolean steps - ); -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/MapboxDirections.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/MapboxDirections.java deleted file mode 100644 index f08053dfd..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/MapboxDirections.java +++ /dev/null @@ -1,461 +0,0 @@ -package com.mapbox.services.api.directions.v4; - -import com.mapbox.services.api.MapboxBuilder; -import com.mapbox.services.api.MapboxService; -import com.mapbox.services.api.ServicesException; -import com.mapbox.services.commons.utils.TextUtils; -import com.mapbox.services.api.directions.v4.models.DirectionsResponse; -import com.mapbox.services.api.directions.v4.models.Waypoint; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; -import retrofit2.Retrofit; -import retrofit2.converter.gson.GsonConverterFactory; - -/** - * Mapbox Directions v4 client. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class MapboxDirections extends MapboxService { - - private Builder builder = null; - private DirectionsService service = null; - private Call call = null; - - /** - * Mapbox builder - * - * @param builder {@link Builder} - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public MapboxDirections(Builder builder) { - this.builder = builder; - } - - /** - * Used internally. - * - * @return DirectionsService - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public DirectionsService getService() { - // No need to recreate it - if (service != null) { - return service; - } - - Retrofit retrofit = new Retrofit.Builder() - .client(getOkHttpClient()) - .baseUrl(builder.getBaseUrl()) - .addConverterFactory(GsonConverterFactory.create()) - .build(); - service = retrofit.create(DirectionsService.class); - return service; - } - - /** - * Used internally. - * - * @return The directions response call. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Call getCall() { - // No need to recreate it - if (call != null) { - return call; - } - - call = getService().getCall( - getHeaderUserAgent(builder.getClientAppName()), - builder.getProfile(), - builder.getWaypoints(), - builder.getAccessToken(), - builder.isAlternatives(), - builder.getInstructions(), - builder.getGeometry(), - builder.isSteps()); - - return call; - } - - /** - * Execute the call - * - * @return The Directions v4 response - * @throws IOException Signals that an I/O exception of some sort has occurred. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public Response executeCall() throws IOException { - return getCall().execute(); - } - - /** - * Execute the call - * - * @param callback A Retrofit callback. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public void enqueueCall(Callback callback) { - getCall().enqueue(callback); - } - - /** - * Cancel the call - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public void cancelCall() { - getCall().cancel(); - } - - /** - * clone the call - * - * @return cloned call - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public Call cloneCall() { - return getCall().clone(); - } - - /** - * Directions v4 builder - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public static class Builder extends MapboxBuilder { - - private String accessToken; - private String profile; - private List waypoints; - private Waypoint origin; - private Waypoint destination; - private Boolean alternatives; - private String instructions; - private String geometry; - private Boolean steps; - - /** - * Required to call when building {@link com.mapbox.services.api.directions.v4.MapboxDirections.Builder}. - * - * @param accessToken Mapbox access token, You must have a Mapbox account inorder to use - * this library. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public Builder setAccessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Specify what routing profile you'd like: driving, walking, or cycling. - * - * @param profile {@link DirectionsCriteria#PROFILE_DRIVING}, - * {@link DirectionsCriteria#PROFILE_CYCLING}, or {@link DirectionsCriteria#PROFILE_WALKING} - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setProfile(String profile) { - this.profile = profile; - return this; - } - - /** - * If you have more then one destination, call this method passing in a list of all - * waypoints including origin and final destination. - * - * @param waypoints List including all {@link Waypoint} you'd line to include in route. - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setWaypoints(List waypoints) { - this.waypoints = waypoints; - return this; - } - - /** - * Origin of the destination. - * - * @param origin {@link Waypoint} of origin. - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setOrigin(Waypoint origin) { - this.origin = origin; - return this; - } - - /** - * Final destination of your route, call this only if you have one destination, otherwise, - * use {@link #setWaypoints(List)} - * - * @param destination {@link Waypoint} of destination. - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setDestination(Waypoint destination) { - this.destination = destination; - return this; - } - - /** - * Optionally, call if you'd like to receive alternative routes besides just one. - * - * @param alternatives true if you'd like alternative routes, else false. - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setAlternatives(Boolean alternatives) { - this.alternatives = alternatives; - return this; - } - - /** - * Optionally, call if you'd like to receive human-readable instructions. - * - * @param instructions {@link DirectionsCriteria#INSTRUCTIONS_TEXT} or - * {@link DirectionsCriteria#INSTRUCTIONS_HTML} - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setInstructions(String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Optionally, call with the format you'd like the route geometry to be in. - * - * @param geometry {@link DirectionsCriteria#GEOMETRY_GEOJSON}, - * {@link DirectionsCriteria#GEOMETRY_POLYLINE}, or {@link DirectionsCriteria#GEOMETRY_FALSE} - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setGeometry(String geometry) { - this.geometry = geometry; - return this; - } - - /** - * Optionally, call if you'd like to include step information within route. - * - * @param steps true if you'd like step information. - * @return Builder - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setSteps(Boolean steps) { - this.steps = steps; - return this; - } - - /** - * @return your Mapbox access token. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public String getAccessToken() { - return accessToken; - } - - /** - * @return {@link DirectionsCriteria#PROFILE_DRIVING}, - * {@link DirectionsCriteria#PROFILE_CYCLING}, or {@link DirectionsCriteria#PROFILE_WALKING} - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getProfile() { - return profile; - } - - /** - * @return List including all {@link Waypoint} within route. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getWaypoints() { - String waypointsFormatted = ""; - - // Set origin and destination - if (origin != null && destination != null) { - waypoints = new ArrayList<>(Arrays.asList(origin, destination)); - } - - // Empty list - if (waypoints == null || waypoints.size() == 0) { - return waypointsFormatted; - } - - // Convert to {lon},{lat} coordinate pairs - List pieces = new ArrayList<>(); - for (Waypoint waypoint : waypoints) { - pieces.add(String.format(Locale.US, "%f,%f", - waypoint.getLongitude(), - waypoint.getLatitude())); - } - - // The waypoints parameter should be a semicolon-separated list of locations to visit - waypointsFormatted = TextUtils.join(";", pieces.toArray()); - return waypointsFormatted; - } - - /** - * @return routes origin {@link Waypoint}. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Waypoint getOrigin() { - return origin; - } - - /** - * @return routes final destination {@link Waypoint}. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Waypoint getDestination() { - return destination; - } - - /** - * @return true if you {@link #setAlternatives(Boolean)} to true. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Boolean isAlternatives() { - return alternatives; - } - - /** - * @return {@link DirectionsCriteria#INSTRUCTIONS_TEXT} or - * {@link DirectionsCriteria#INSTRUCTIONS_HTML} - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getInstructions() { - return instructions; - } - - /** - * @return {@link DirectionsCriteria#GEOMETRY_GEOJSON}, - * {@link DirectionsCriteria#GEOMETRY_POLYLINE}, or {@link DirectionsCriteria#GEOMETRY_FALSE} - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getGeometry() { - return geometry; - } - - /** - * @return true if you requested step information in {@link #setSteps(Boolean)}. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Boolean isSteps() { - return steps; - } - - /** - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Builder setClientAppName(String appName) { - super.clientAppName = appName; - return this; - } - - /** - * Build the MapboxDirections - * - * @return {@link MapboxDirections} - * @throws ServicesException Generic Exception for all things directions. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - @Override - public MapboxDirections build() throws ServicesException { - validateAccessToken(accessToken); - - // We force the geometry to be a polyline to make the request more efficient. - // We have utils to transform polylines into a LineString easily. - geometry = DirectionsCriteria.GEOMETRY_POLYLINE; - - return new MapboxDirections(this); - } - - /** - * Set the base url of the API. - * - * @param baseUrl base url used as end point - * @return the current MapboxBuilder instance - * @since 2.0.0 - * @deprecated Use Directions v5 instead - */ - @Override - @Deprecated - public MapboxBuilder setBaseUrl(String baseUrl) { - super.baseUrl = baseUrl; - return this; - } - } - -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsFeature.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsFeature.java deleted file mode 100644 index d7f50bfc1..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsFeature.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -/** - * Defines a GeoJSON Feature Object - * with a Point geometry type. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class DirectionsFeature { - - private String type; - private FeatureGeometry geometry; - private FeatureProperties properties; - - /** - * The type of the GeoJSON object. - * - * @return string type. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getType() { - return type; - } - - /** - * @param type The type of the GeoJSON object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setType(String type) { - this.type = type; - } - - /** - * {@link FeatureGeometry} object contains type and the coordinates. - * - * @return {@link FeatureGeometry} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public FeatureGeometry getGeometry() { - return geometry; - } - - /** - * @param geometry {@link FeatureGeometry} object contains type and the coordinates. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setGeometry(FeatureGeometry geometry) { - this.geometry = geometry; - } - - /** - * Properties describing the point. This includes, at a minimum, a name. - * - * @return {@link FeatureProperties} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public FeatureProperties getProperties() { - return properties; - } - - /** - * @param properties Properties describing the point. This includes, at a minimum, a name. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setProperties(FeatureProperties properties) { - this.properties = properties; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsResponse.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsResponse.java deleted file mode 100644 index 4698b7c17..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsResponse.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * The response to a directions request. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class DirectionsResponse { - - private DirectionsFeature origin; - private DirectionsFeature destination; - private List waypoints; - private List routes; - - public DirectionsResponse() { - waypoints = new ArrayList<>(); - routes = new ArrayList<>(); - } - - /** - * Gives details about the origin of the route. - * - * @return {@link DirectionsFeature} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public DirectionsFeature getOrigin() { - return origin; - } - - /** - * @param origin Details about the origin of the route. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setOrigin(DirectionsFeature origin) { - this.origin = origin; - } - - /** - * Gives details about the destination of the route. - * - * @return {@link DirectionsFeature} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public DirectionsFeature getDestination() { - return destination; - } - - /** - * @param destination Details about the destination of the route. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDestination(DirectionsFeature destination) { - this.destination = destination; - } - - /** - * A List of {@link DirectionsFeature} objects representing intermediate waypoints along route, - * if any exist. If you request directions with more then two waypoints (origin and destination) - * addition information about those intermediate points will be given here in a List object. - * - * @return List of {@link DirectionsFeature} objects. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public List getWaypoints() { - return waypoints; - } - - /** - * @param waypoints List of {@link DirectionsFeature} objects. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setWaypoints(List waypoints) { - this.waypoints = waypoints; - } - - /** - * List containing all the different route options. It's ordered by descending recommendation - * rank. In other words, object 0 in the List is the highest recommended route. if you - * setAlternatives to false (default is true) in your builder this should always be a List of - * size 1. - * - * @return List of {@link DirectionsRoute} objects. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public List getRoutes() { - return routes; - } - - /** - * @param routes List of {@link DirectionsRoute} objects. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setRoutes(List routes) { - this.routes = routes; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsRoute.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsRoute.java deleted file mode 100644 index 058ac1bc0..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/DirectionsRoute.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -import com.mapbox.services.commons.geojson.LineString; - -import java.util.ArrayList; -import java.util.List; - -/** - * Gives detailed information about an individual route such as the duration, distance and geometry. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class DirectionsRoute { - - private int distance; - private int duration; - private String summary; - private String geometry; - private List steps; - - public DirectionsRoute() { - steps = new ArrayList<>(); - } - - /** - * The distance traveled from origin to destination. - * - * @return An integer number with unit meters. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public int getDistance() { - return distance; - } - - /** - * @param distance The distance traveled from origin to destination. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDistance(int distance) { - this.distance = distance; - } - - /** - * The estimated travel time from origin to destination. - * - * @return an integer number with unit seconds. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public int getDuration() { - return duration; - } - - /** - * @param duration The estimated travel time from origin to destination. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDuration(int duration) { - this.duration = duration; - } - - /** - * A short, human-readable summary of the route (e.g., major roads traversed). - * - * @return a string briefly describing route. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getSummary() { - return summary; - } - - /** - * @param summary A short, human-readable summary of the route (e.g., major roads traversed). - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setSummary(String summary) { - this.summary = summary; - } - - /** - * Gives the geometry of the route. Commonly used to draw the route on the map view. - * - * @return encoded polyline with precision 6. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getGeometry() { - return geometry; - } - - /** - * @param geometry The geometry of the route. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setGeometry(String geometry) { - this.geometry = geometry; - } - - /** - * Steps gives you the route instructions. - * - * @return List of {@link RouteStep} objects. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public List getSteps() { - return steps; - } - - /** - * @param steps The route instructions. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setSteps(List steps) { - this.steps = steps; - } - - /** - * Gets a GeoJSON LineString which can be used to get route coordinates useful for - * drawing on a map view. - * - * @param precision of encoded polyline. - * @return GeoJSON LineString. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public LineString asLineString(int precision) { - return LineString.fromPolyline(getGeometry(), precision); - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureGeometry.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureGeometry.java deleted file mode 100644 index 762cb6ed3..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureGeometry.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Describes the geometry of a {@link DirectionsFeature}. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class FeatureGeometry { - - private String type; - private List coordinates; - - /** - * Builder - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public FeatureGeometry() { - coordinates = new ArrayList<>(); - } - - /** - * Gives GeoJSON geometry type. - * - * @return string naming GeoJSON geometry type. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getType() { - return type; - } - - /** - * @param type The GeoJSON geometry type. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setType(String type) { - this.type = type; - } - - /** - * Gives the coordinate of the point. Longitude will always be first (index 0) in list and - * latitude will be second (index 1). - * - * @return List of Double objects containing a point with longitude and latitude values. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public List getCoordinates() { - return coordinates; - } - - /** - * @param coordinates List of Double objects containing a point with longitude and latitude - * values. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setCoordinates(List coordinates) { - this.coordinates = coordinates; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureProperties.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureProperties.java deleted file mode 100644 index 8ea6abfd0..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/FeatureProperties.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -/** - * Properties describing a {@link DirectionsFeature}. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class FeatureProperties { - - private String name; - - /** - * Gives the name of the closest street to the {@link DirectionsFeature} point. - * - * @return String name. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getName() { - return name; - } - - /** - * @param name String name. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setName(String name) { - this.name = name; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/ManeuverPoint.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/ManeuverPoint.java deleted file mode 100644 index d6965c6c5..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/ManeuverPoint.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * If turn-by-turn directions were requested for route, each step gives the location in which it - * should occur. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class ManeuverPoint { - - private String type; - private List coordinates; - - /** - * Builder - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public ManeuverPoint() { - coordinates = new ArrayList<>(); - } - - /** - * Gives the GeoJSON geometry type. - * - * @return String naming type. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getType() { - return type; - } - - /** - * @param type String naming type. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setType(String type) { - this.type = type; - } - - /** - * Gives the coordinate of the Point. Longitude will always be first (index 0) in list and - * latitude will be second (index 1). - * - * @return List of Double objects containing a point with longitude and latitude values. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public List getCoordinates() { - return coordinates; - } - - /** - * @param coordinates List of Double objects containing a point with longitude and latitude - * values. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setCoordinates(List coordinates) { - this.coordinates = coordinates; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/RouteStep.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/RouteStep.java deleted file mode 100644 index 37ed27f36..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/RouteStep.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -import com.google.gson.annotations.SerializedName; - -/** - * The instructions for a route are broken down into steps with each step containing details like - * heading, direction, way name, and duration. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class RouteStep { - - private int distance; - private int duration; - @SerializedName("wayName") - private String wayName; - private String direction; - private double heading; - private StepManeuver maneuver; - - /** - * The distance of travel from the maneuver to the subsequent step. - * - * @return integer distance given in meters. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public int getDistance() { - return distance; - } - - /** - * @param distance integer distance given in meters. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDistance(int distance) { - this.distance = distance; - } - - /** - * The estimated travel time from the maneuver to the subsequent step. - * - * @return integer number given in seconds. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public int getDuration() { - return duration; - } - - /** - * @param duration integer number given in seconds. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDuration(int duration) { - this.duration = duration; - } - - /** - * The name of the way along which travel proceeds. - * - * @return string containing a name. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getWayName() { - return wayName; - } - - /** - * @param wayName string containing a name. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setWayName(String wayName) { - this.wayName = wayName; - } - - /** - * The approximate cardinal direction of travel following the maneuver. Typically one of the - * following: 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', or 'NW'. - * - * @return string containing abbreviated cardinal direction. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getDirection() { - return direction; - } - - /** - * @param direction string containing abbreviated cardinal direction. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setDirection(String direction) { - this.direction = direction; - } - - /** - * The clockwise angle from true north to the direction of travel immediately following the maneuver. - * - * @return double value ranging from 0 to 359. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public double getHeading() { - return heading; - } - - /** - * @param heading Double value ranging from 0 to 359. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setHeading(double heading) { - this.heading = heading; - } - - /** - * A {@link StepManeuver} object representing the step maneuver. - * - * @return a {@link StepManeuver} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public StepManeuver getManeuver() { - return maneuver; - } - - /** - * @param maneuver A {@link StepManeuver} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setManeuver(StepManeuver maneuver) { - this.maneuver = maneuver; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/StepManeuver.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/StepManeuver.java deleted file mode 100644 index 5d1c0c344..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/StepManeuver.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -/** - * Used to describe a instruction step maneuver. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class StepManeuver { - - private String type; - private ManeuverPoint location; - private String instruction; - private String mode; - - /** - * A specific string describing the type of maneuver. The following types are currently used: - * continue, bear right, turn right, sharp right, u-turn, sharp left, turn left, bear left, - * waypoint, depart, enter roundabout, and arrive. Warning, new maneuver types may be introduced - * in the future however, so check here - * to ensure you don't miss any. - * - * @return string with possibly one of the maneuvers given above. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getType() { - return type; - } - - /** - * @param type string with possibly one of the maneuvers given above. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setType(String type) { - this.type = type; - } - - /** - * {@link ManeuverPoint} object containing type and the coordinate. - * - * @return {@link ManeuverPoint} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public ManeuverPoint getLocation() { - return location; - } - - /** - * @param location {@link ManeuverPoint} object. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setLocation(ManeuverPoint location) { - this.location = location; - } - - /** - * Human-readable string describing the maneuver. typically combines {@link #getType()} and a - * street name. if within {@code MapboxDirections.Builder} you setInstructions to HTML, you'll - * relieve the instructions in HTML format. - * - * @return string typically the length of a sentence giving next maneuver instruction. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getInstruction() { - return instruction; - } - - /** - * @param instruction string typically the length of a sentence giving next maneuver instruction. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setInstruction(String instruction) { - this.instruction = instruction; - } - - /** - * A string signifying the mode of transportation. Possible values can be: - *

For driving: driving, ferry, movable bridge, unaccessible. - *

For walking: walking, ferry, unaccessible. - *

For cycling: cycling, walking, ferry, train, movable bridge, unaccessible. - * - * @return string with possibly one of the values given above. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public String getMode() { - return mode; - } - - /** - * @param mode string with possibly one of the values given above. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setMode(String mode) { - this.mode = mode; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/Waypoint.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/Waypoint.java deleted file mode 100644 index cf4e02418..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/Waypoint.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.mapbox.services.api.directions.v4.models; - -/** - * A point on earth represented by a longitude/latitude pair. - * - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ -@Deprecated -public class Waypoint { - - private double latitude; - private double longitude; - - /** - * Construct a location with a longitude latitude pair. - * - * @param longitude double value ranging from -180.0 to 180.0. - * @param latitude double value ranging from -90.0 to 90.0. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public Waypoint(double longitude, double latitude) { - this.longitude = longitude; - this.latitude = latitude; - } - - /** - * The latitude of the location. - * - * @return double value ranging from -90.0 to 90.0. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public double getLatitude() { - return latitude; - } - - /** - * @param latitude double value ranging from -90.0 to 90.0. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - /** - * The longitude of the location. - * - * @return double value ranging from -180.0 to 180.0. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public double getLongitude() { - return longitude; - } - - /** - * @param longitude double value ranging from -180.0 to 180.0. - * @since 1.0.0 - * @deprecated Use Directions v5 instead - */ - @Deprecated - public void setLongitude(double longitude) { - this.longitude = longitude; - } -} diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/package-info.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/package-info.java deleted file mode 100644 index 763046fe4..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Contains the Mapbox Java Services classes. - * - * @deprecated Use Directions v5 instead - */ -package com.mapbox.services.api.directions.v4.models; diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/package-info.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/package-info.java deleted file mode 100644 index 73d3727c7..000000000 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v4/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Contains the Mapbox Java Services classes. - * - * @deprecated Use Directions v5 instead - */ -package com.mapbox.services.api.directions.v4;