@@ -92,7 +92,7 @@ protected Call<DirectionsResponse> initializeCall() {
9292 voiceUnits (),
9393 exclude (),
9494 approaches (),
95- waypoints (),
95+ viaWayPoints (),
9696 waypointNames (),
9797 waypointTargets ());
9898 }
@@ -362,7 +362,7 @@ private static String formatWaypointTargets(Point[] waypointTargets) {
362362 abstract String approaches ();
363363
364364 @ Nullable
365- abstract String waypoints ();
365+ abstract String viaWayPoints ();
366366
367367 @ Nullable
368368 abstract String waypointNames ();
@@ -424,7 +424,7 @@ public abstract static class Builder {
424424 private Point destination ;
425425 private Point origin ;
426426 private String [] approaches ;
427- private Integer [] waypoints ;
427+ private Integer [] viaWayPoints ;
428428 private String [] waypointNames ;
429429 private Point [] waypointTargets ;
430430
@@ -794,24 +794,24 @@ public Builder addApproaches(String... approaches) {
794794 abstract Builder approaches (@ Nullable String approaches );
795795
796796 /**
797- * Optionally, set which input coordinates should be treated as waypoints .
797+ * Optionally, set which input coordinates should be treated as via way points .
798798 * <p>
799799 * Most useful in combination with steps=true and requests based on traces
800800 * with high sample rates. Can be an index corresponding to any of the input coordinates,
801801 * but must contain the first ( 0 ) and last coordinates' index separated by ; .
802802 * {@link #steps()}
803803 * </p>
804804 *
805- * @param waypoints integer array of coordinate indices to be used as waypoints
805+ * @param viaWayPoints integer array of coordinate indices to be used as via way points
806806 * @return this builder for chaining options together
807807 * @since 4.4.0
808808 */
809- public Builder addWaypoints (@ Nullable @ IntRange (from = 0 ) Integer ... waypoints ) {
810- this .waypoints = waypoints ;
809+ public Builder addViaWayPoints (@ Nullable @ IntRange (from = 0 ) Integer ... viaWayPoints ) {
810+ this .viaWayPoints = viaWayPoints ;
811811 return this ;
812812 }
813813
814- abstract Builder waypoints (@ Nullable String waypoints );
814+ abstract Builder viaWayPoints (@ Nullable String viaWayPoints );
815815
816816 /**
817817 * Custom names for waypoints used for the arrival instruction,
@@ -871,20 +871,21 @@ public MapboxDirections build() {
871871 + " directions API request." );
872872 }
873873
874- if (waypoints != null ) {
875- if (waypoints .length < 2 ) {
874+ if (viaWayPoints != null ) {
875+ if (viaWayPoints .length < 2 ) {
876876 throw new ServicesException (
877- "Waypoints must be a list of at least two indexes separated by ';'" );
877+ "Via way points must be a list of at least two indexes separated by ';'" );
878878 }
879- if (waypoints [0 ] != 0 || waypoints [waypoints .length - 1 ] != coordinates .size () - 1 ) {
879+ if (viaWayPoints [0 ] != 0
880+ || viaWayPoints [viaWayPoints .length - 1 ] != coordinates .size () - 1 ) {
880881 throw new ServicesException (
881- "Waypoints must contain indices of the first and last coordinates"
882+ "Via way points must contain indices of the first and last coordinates"
882883 );
883884 }
884- for (int i = 1 ; i < waypoints .length - 1 ; i ++) {
885- if (waypoints [i ] < 0 || waypoints [i ] >= coordinates .size ()) {
885+ for (int i = 1 ; i < viaWayPoints .length - 1 ; i ++) {
886+ if (viaWayPoints [i ] < 0 || viaWayPoints [i ] >= coordinates .size ()) {
886887 throw new ServicesException (
887- "Waypoints index too large (no corresponding coordinate)" );
888+ "Via way points index too large (no corresponding coordinate)" );
888889 }
889890 }
890891 }
@@ -923,7 +924,7 @@ public MapboxDirections build() {
923924 bearing (TextUtils .formatBearing (bearings ));
924925 annotation (TextUtils .join ("," , annotations ));
925926 radius (TextUtils .formatRadiuses (radiuses ));
926- waypoints (TextUtils .join (";" , waypoints ));
927+ viaWayPoints (TextUtils .join (";" , viaWayPoints ));
927928
928929 MapboxDirections directions = autoBuild ();
929930
0 commit comments