Package es.situm.sdk.navigation
Class NavigationRequest.Builder
- java.lang.Object
-
- es.situm.sdk.navigation.NavigationRequest.Builder
-
- Enclosing class:
- NavigationRequest
public static final class NavigationRequest.Builder extends Object
NavigationStatebuilder static inner class.
-
-
Constructor Summary
Constructors Constructor Description Builder()Builder(NavigationRequest copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NavigationRequestbuild()Returns aNavigationStatewith the previously set parameters.NavigationRequest.BuilderdistanceToChangeFloorThreshold(double distanceToChangeFloorThreshold)Sets the distance threshold from when a floor change is considered reached.NavigationRequest.BuilderdistanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold)Sets the distance threshold from when the next indication is considered reached.NavigationRequest.BuilderdistanceToGoalThreshold(double distanceToGoalThreshold)Sets the distance threshold from when the goal is considered reached.NavigationRequest.BuilderdistanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication)Sets the maximum distance to ignore the first indication when navigating a route.NavigationRequest.BuilderignoreLowQualityLocations(boolean ignoreLowQualityLocations)Set if low quality locations should be ignored.NavigationRequest.BuilderindicationsInterval(long millis)Sets the time to wait between indications.NavigationRequest.BuilderoutsideRouteThreshold(double outsideRouteThreshold)Sets theoutsideRouteThreshold.NavigationRequest.BuilderroundIndicationsStep(int meters)Sets the step that will be used to round indications distance.NavigationRequest.Builderroute(Route route)Sets theRoutewhose progress is going to be updated.NavigationRequest.BuildertimeToFirstIndication(long millis)Sets the time to wait until the first indication is returned.NavigationRequest.BuildertimeToIgnoreUnexpectedFloorChanges(int millis)Sets the time (in millis) to ignore the locations received during navigation, when the next indication is a floor change, if the locations are in a wrong floor (not in origin or destination floors).
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(@NonNull NavigationRequest copy)
-
-
Method Detail
-
route
@NonNull public NavigationRequest.Builder route(@NonNull Route route)
Sets theRoutewhose progress is going to be updated.- Parameters:
route- therouteto set, so that the methods can be chained together.- Returns:
- a reference to this Builder
-
distanceToChangeFloorThreshold
@NonNull public NavigationRequest.Builder distanceToChangeFloorThreshold(double distanceToChangeFloorThreshold)
Sets the distance threshold from when a floor change is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_CHANGE_FLOOR}.- Parameters:
distanceToChangeFloorThreshold- thedistanceToChangeFloorThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToChangeIndicationThreshold
@NonNull public NavigationRequest.Builder distanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold)
Sets the distance threshold from when the next indication is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_TO_CHANGE_INDICATION}.- Parameters:
distanceToChangeIndicationThreshold- thedistanceToChangeIndicationThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
outsideRouteThreshold
@NonNull public NavigationRequest.Builder outsideRouteThreshold(double outsideRouteThreshold)
Sets theoutsideRouteThreshold. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.- Parameters:
outsideRouteThreshold- theoutsideRouteThresholdto set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToIgnoreFirstIndication
@NonNull public NavigationRequest.Builder distanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication)
Sets the maximum distance to ignore the first indication when navigating a route. This will allow to inform the user of the next turn some metres before reaching the intersection. Default value is {NavigationRequest.DEFAULT_DISTANCE_TO_IGNORE_FIRST_INDICATION}.- Parameters:
distanceToIgnoreFirstIndication- thedistanceToIgnoreFirstIndicationto set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToGoalThreshold
@NonNull public NavigationRequest.Builder distanceToGoalThreshold(double distanceToGoalThreshold)
Sets the distance threshold from when the goal is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.- Parameters:
distanceToGoalThreshold- thedistanceToGoalThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
indicationsInterval
@NonNull public NavigationRequest.Builder indicationsInterval(long millis)
Sets the time to wait between indications. Default value isNavigationRequest.DEFAULT_INDICATIONS_INTERVALmilliseconds. With a value of 0 a new indication will be returned every time a new position is computed. If the value is different than 0 the indications may not be synchronized with theRouteStepin theNavigationProgress
-
timeToFirstIndication
@NonNull public NavigationRequest.Builder timeToFirstIndication(long millis)
Sets the time to wait until the first indication is returned. This is recommended when positioning is started along with navigation, in order to provide more accurate and stable indications. Default value isNavigationRequest.DEFAULT_TIME_TO_FIRST_INDICATIONmilliseconds. With a value of 0 the first indication will be returned as soon as it is calculated. If a non zero value is used it will returnIndication.CALCULATINGduring that time.
-
roundIndicationsStep
@NonNull public NavigationRequest.Builder roundIndicationsStep(int meters)
Sets the step that will be used to round indications distance. For example, with a step of 5, a 13 meters indication will be transformed into a 15 meters indication. Default value isNavigationRequest.DEFAULT_ROUND_INDICATION_STEPmeters. With a value of 0 it won't round indications distance.
-
timeToIgnoreUnexpectedFloorChanges
@NonNull public NavigationRequest.Builder timeToIgnoreUnexpectedFloorChanges(int millis)
Sets the time (in millis) to ignore the locations received during navigation, when the next indication is a floor change, if the locations are in a wrong floor (not in origin or destination floors). Default value isNavigationRequest.DEFAULT_TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGESWith a value of 0 it won't ignore any location.
-
ignoreLowQualityLocations
@NonNull public NavigationRequest.Builder ignoreLowQualityLocations(boolean ignoreLowQualityLocations)
Set if low quality locations should be ignored. With this option enabled, Location updates withLocation.Quality.LOWLocation.Qualitywill be ignored for navigation. This will improve the feasibility of the indications, specially on start and during a floor change, but navigation could freeze if too many low quality locations are received. When starting the navigation, aNavigationProgresswon't be sent until a high quality location is received. You should manage this case in your application by showing a "calculating" dialog or similar. During navigation, if low quality locations are received, no NavigationProgress will be sent until a high quality location is received. Default value isNavigationRequest.DEFAULT_IGNORE_LOW_QUALITY_LOCATIONS.
-
build
@NonNull public NavigationRequest build() throws IllegalArgumentException
Returns aNavigationStatewith the previously set parameters.- Returns:
NavigationState- Throws:
IllegalArgumentException
-
-