-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cameron Mace
authored
Oct 25, 2017
1 parent
7d1375f
commit 4f872e2
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...gation/src/main/java/com/mapbox/services/android/navigation/v5/utils/ValidationUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.mapbox.services.android.navigation.v5.utils; | ||
|
||
import com.mapbox.directions.v5.models.DirectionsRoute; | ||
|
||
import java.util.MissingFormatArgumentException; | ||
|
||
public final class ValidationUtils { | ||
|
||
private ValidationUtils() { | ||
// Class should not be initialized. | ||
} | ||
|
||
public static void validDirectionsRoute(DirectionsRoute directionsRoute, | ||
boolean defaultMilestonesEnabled) { | ||
if (!directionsRoute.routeOptions().voiceInstructions() && defaultMilestonesEnabled) { | ||
throw new MissingFormatArgumentException("Using the default milestone requires the " | ||
+ "directions route to include the voice instructions object."); | ||
} | ||
} | ||
} |