Skip to content

Commit f476ab1

Browse files
author
Cameron Mace
authored
Missing javadoc added (#442)
* added some javadoc fixes * finished adding missing javadoc * added optimized trip javadoc * fixed checkstyle issue
1 parent 08cad42 commit f476ab1

21 files changed

Lines changed: 643 additions & 148 deletions

File tree

mapbox/libandroid-services/gradle-javadoc.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android.libraryVariants.all { variant ->
55
failOnError = false
66
destinationDir = new File(destinationDir, variant.baseName)
77
source = files(variant.javaCompile.source)
8-
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath) + files("../../../../libjava/lib/src/main/java")
8+
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath) + files("../libjava-services/lib/src/main/java")
99
options.windowTitle("Mapbox Android Services SDK $VERSION_NAME Reference")
1010
options.docTitle("Mapbox Android Services SDK $VERSION_NAME")
1111
options.header("Mapbox Android Services SDK $VERSION_NAME Reference")

mapbox/libandroid-telemetry/gradle-javadoc.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android.libraryVariants.all { variant ->
55
failOnError = false
66
destinationDir = new File(destinationDir, variant.baseName)
77
source = files(variant.javaCompile.source)
8-
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath) + files("../../../../libjava/lib/src/main/java")
8+
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
99
options.windowTitle("Mapbox Android Services SDK $VERSION_NAME Reference")
1010
options.docTitle("Mapbox Android Services SDK $VERSION_NAME")
1111
options.header("Mapbox Android Services SDK $VERSION_NAME Reference")

mapbox/libandroid-ui/gradle-javadoc.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android.libraryVariants.all { variant ->
55
failOnError = false
66
destinationDir = new File(destinationDir, variant.baseName)
77
source = files(variant.javaCompile.source)
8-
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
8+
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath) + files("../libandroid-services/lib/src/main/java")
99
options.windowTitle("Mapbox Android Services SDK $VERSION_NAME Reference")
1010
options.docTitle("Mapbox Android Services SDK $VERSION_NAME")
1111
options.header("Mapbox Android Services SDK $VERSION_NAME Reference")

mapbox/libjava-core/src/main/java/com/mapbox/services/commons/utils/TextUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public static String formatCoordinate(double coordinate) {
7171
* Allows the specific adjusting of a coordinates precision.
7272
*
7373
* @param coordinate a double value representing a coordinate.
74+
* @param precision an integer value you'd like the precision to be at.
7475
* @return a formatted string.
7576
* @since 2.1.0
7677
*/

mapbox/libjava-services-rx/src/main/java/com/mapbox/services/api/rx/directionsmatrix/v1/DirectionsMatrixServiceRx.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public interface DirectionsMatrixServiceRx {
2929
* @param sources Array of waypoint objects. Each waypoints is an input coordinate snapped to the road and path
3030
* network. The waypoints appear in the array in the order of the input coordinates, or in the
3131
* order as specified in the sources query parameter.
32+
* @return A retrofit Observable object
3233
* @since 2.1.0
3334
*/
3435
@GET("directions-matrix/v1/{user}/{profile}/{coordinates}")

mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/DirectionsService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public interface DirectionsService {
3535
* @param annotations An annotations object that contains additional details about each line segment along the
3636
* route geometry. Each entry in an annotations field corresponds to a coordinate along the
3737
* route geometry.
38+
* @return The {@link DirectionsResponse} in a Call wrapper.
3839
* @since 1.0.0
3940
*/
4041
@GET("directions/v5/{user}/{profile}/{coordinates}")

mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/MapboxDirections.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ public T setContinueStraight(Boolean continueStraight) {
349349
*
350350
* @param annotation String referencing one of the annotation direction criteria's.
351351
* @return Builder
352-
* @see <a href="https://www.mapbox.com/api-documentation/#routeleg-object">RouteLeg object documentation</a> for
353-
* more information.
352+
* @see <a href="https://www.mapbox.com/api-documentation/#routeleg-object">RouteLeg object documentation</a>
354353
* @since 2.1.0
355354
*/
356355
public T setAnnotation(String... annotation) {
@@ -371,6 +370,8 @@ public String getUser() {
371370
}
372371

373372
/**
373+
* The current profile set for usage with the Directions API.
374+
*
374375
* @return {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#PROFILE_DRIVING_TRAFFIC},
375376
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#PROFILE_DRIVING},
376377
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#PROFILE_CYCLING},
@@ -540,11 +541,25 @@ public String getAnnotation() {
540541
return TextUtils.join(",", annotation);
541542
}
542543

544+
/**
545+
* Base package name or other simple string identifier
546+
*
547+
* @param appName base package name or other simple string identifier
548+
* @return Builder
549+
* @since 1.3.0
550+
*/
543551
public T setClientAppName(String appName) {
544552
super.clientAppName = appName;
545553
return (T) this;
546554
}
547555

556+
/**
557+
* Optionally change the APIs base URL to something other then the default Mapbox one.
558+
*
559+
* @param baseUrl base url used as end point
560+
* @return Builder
561+
* @since 1.3.0
562+
*/
548563
public T setBaseUrl(String baseUrl) {
549564
super.baseUrl = baseUrl;
550565
return (T) this;

mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsResponse.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,22 @@ public class DirectionsResponse {
1313
private List<DirectionsRoute> routes;
1414
private List<DirectionsWaypoint> waypoints;
1515

16+
/**
17+
* Empty constructor
18+
*
19+
* @since 2.1.0
20+
*/
1621
public DirectionsResponse() {
1722
}
1823

24+
/**
25+
* Constructor taking in both a list of {@link DirectionsRoute} and a list of {@link DirectionsWaypoint}s.
26+
*
27+
* @param routes list of routes you can pass in while building this object.
28+
* @param waypoints list of waypoints you can pass in while building this object. Ideally these should match what was
29+
* used to crate the route.
30+
* @since 2.0.0
31+
*/
1932
public DirectionsResponse(List<DirectionsRoute> routes, List<DirectionsWaypoint> waypoints) {
2033
this.routes = routes;
2134
this.waypoints = waypoints;
@@ -32,6 +45,13 @@ public String getCode() {
3245
return code;
3346
}
3447

48+
/**
49+
* String indicating the state of the response. This is a separate code than the HTTP
50+
* status code.
51+
*
52+
* @param code "Ok", "NoRoute", "ProfileNotFound", or "InvalidInput".
53+
* @since 2.1.0
54+
*/
3555
public void setCode(String code) {
3656
this.code = code;
3757
}
@@ -47,6 +67,13 @@ public List<DirectionsWaypoint> getWaypoints() {
4767
return waypoints;
4868
}
4969

70+
/**
71+
* List with Waypoints of locations snapped to the road and path network and should appear in the List
72+
* in the order of the input coordinates.
73+
*
74+
* @param waypoints List of {@link DirectionsWaypoint} objects.
75+
* @since 2.1.0
76+
*/
5077
public void setWaypoints(List<DirectionsWaypoint> waypoints) {
5178
this.waypoints = waypoints;
5279
}
@@ -64,6 +91,15 @@ public List<DirectionsRoute> getRoutes() {
6491
return routes;
6592
}
6693

94+
/**
95+
* List containing all the different route options. It should be ordered by descending recommendation
96+
* rank. In other words, object 0 in the List is the highest recommended route. if you don't
97+
* setAlternatives to true (default is false) in your builder this should always be a List of
98+
* size 1.
99+
*
100+
* @param routes List of {@link DirectionsRoute} objects.
101+
* @since 2.1.0
102+
*/
67103
public void setRoutes(List<DirectionsRoute> routes) {
68104
this.routes = routes;
69105
}

mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsRoute.java

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,56 @@ public double getDistance() {
3434

3535
/**
3636
* The distance traveled from origin to destination.
37-
* <p>
38-
* Sets a double number with unit meters.
3937
*
40-
* @since 2.0.1
38+
* @param distance a double number with unit meters.
39+
* @since 2.1.0
4140
*/
4241
public void setDistance(double distance) {
4342
this.distance = distance;
4443
}
4544

45+
/**
46+
* The name of the weight profile used while calculating during extraction phase. In many cases, this will return
47+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_ROUTABILITY},
48+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_DURATION}, or
49+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_DISTANCE}.
50+
*
51+
* @return a String representing the weight profile used while calculating the route.
52+
* @since 2.1.0
53+
*/
4654
public String getWeightName() {
4755
return weightName;
4856
}
4957

58+
/**
59+
* The name of the weight profile used while calculating during extraction phase. In many cases, this would be
60+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_ROUTABILITY},
61+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_DURATION}, or
62+
* {@link com.mapbox.services.api.directions.v5.DirectionsCriteria#WEIGHT_NAME_DISTANCE}.
63+
*
64+
* @param weightName a String representing the weight profile used while calculating the route.
65+
* @since 2.1.0
66+
*/
5067
public void setWeightName(String weightName) {
5168
this.weightName = weightName;
5269
}
5370

71+
/**
72+
* The calculated weight of the route.
73+
*
74+
* @return the weight value provided from the API as a {@code double} value.
75+
* @since 2.1.0
76+
*/
5477
public double getWeight() {
5578
return weight;
5679
}
5780

81+
/**
82+
* The calculated weight of the route.
83+
*
84+
* @param weight the weight value as a {@code double} value.
85+
* @since 2.1.0
86+
*/
5887
public void setWeight(double weight) {
5988
this.weight = weight;
6089
}
@@ -71,10 +100,9 @@ public double getDuration() {
71100

72101
/**
73102
* The estimated travel time from origin to destination.
74-
* <p>
75-
* Sets a double number with unit seconds.
76103
*
77-
* @since 2.0.1
104+
* @param duration a double number with unit seconds.
105+
* @since 2.1.0
78106
*/
79107
public void setDuration(double duration) {
80108
this.duration = duration;
@@ -92,16 +120,14 @@ public String getGeometry() {
92120

93121
/**
94122
* Sets the geometry of the route. Commonly used to draw the route on the map view.
95-
* <p>
96-
* Sets An encoded polyline string.
97123
*
98-
* @since 2.0.1
124+
* @param geometry an encoded polyline string.
125+
* @since 2.1.0
99126
*/
100127
public void setGeometry(String geometry) {
101128
this.geometry = geometry;
102129
}
103130

104-
105131
/**
106132
* A Leg is a route between only two waypoints
107133
*
@@ -112,17 +138,13 @@ public List<RouteLeg> getLegs() {
112138
return legs;
113139
}
114140

115-
116141
/**
117142
* A Leg is a route between only two waypoints
118-
* <p>
119-
* Sets List of {@link RouteLeg} objects.
120143
*
121-
* @since 2.0.1
144+
* @param legs list of {@link RouteLeg} objects.
145+
* @since 2.1.0
122146
*/
123147
public void setLegs(List<RouteLeg> legs) {
124148
this.legs = legs;
125149
}
126-
127-
128150
}

mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsWaypoint.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ public class DirectionsWaypoint {
1212
private String name;
1313
private double[] location;
1414

15+
/**
16+
* Empty constructor
17+
*
18+
* @since 2.0.0
19+
*/
1520
public DirectionsWaypoint() {
1621
}
1722

1823
/**
24+
* Provides the way name which the waypoint's coordinate is snapped to.
25+
*
1926
* @return String with the name of the way the coordinate snapped to.
2027
* @since 1.0.0
2128
*/
@@ -24,15 +31,18 @@ public String getName() {
2431
}
2532

2633
/**
27-
* Sets String with the name of the way the coordinate snapped to.
34+
* Provide a way name which the waypoint's coordinate is snapped to.
2835
*
29-
* @since 2.0.1
36+
* @param name a String with the name of the way the coordinate snapped to.
37+
* @since 2.1.0
3038
*/
3139
public void setName(String name) {
3240
this.name = name;
3341
}
3442

3543
/**
44+
* an array with two double values reresenting the maneuver locations coordinate.
45+
*
3646
* @return double array of [longitude, latitude] for the snapped coordinate.
3747
* @since 1.0.0
3848
*/
@@ -43,7 +53,8 @@ public double[] getLocation() {
4353
/**
4454
* Sets double array of [longitude, latitude] for the snapped coordinate.
4555
*
46-
* @since 2.0.1
56+
* @param location array with the order [longitude, latitude].
57+
* @since 2.1.0
4758
*/
4859
public void setLocation(double[] location) {
4960
this.location = location;

0 commit comments

Comments
 (0)