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 java.lang.Object
NavigationState
builder 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 NavigationRequest
build()
Returns aNavigationState
with the previously set parameters.NavigationRequest.Builder
distanceToChangeFloorThreshold(double distanceToChangeFloorThreshold)
Sets the distance threshold from when a floor change is considered reached.NavigationRequest.Builder
distanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold)
Sets the distance threshold from when the next indication is considered reached.NavigationRequest.Builder
distanceToGoalThreshold(double distanceToGoalThreshold)
Sets the distance threshold from when the goal is considered reached.NavigationRequest.Builder
distanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication)
Sets the maximum distance to ignore the first indication when navigating a route.NavigationRequest.Builder
ignoreLowQualityLocations(boolean ignoreLowQualityLocations)
Set if low quality locations should be ignored.NavigationRequest.Builder
indicationsInterval(long millis)
Sets the time to wait between indications.NavigationRequest.Builder
outsideRouteThreshold(double outsideRouteThreshold)
Sets theoutsideRouteThreshold
.NavigationRequest.Builder
roundIndicationsStep(int meters)
Sets the step that will be used to round indications distance.NavigationRequest.Builder
route(Route route)
Sets theRoute
whose progress is going to be updated.NavigationRequest.Builder
timeToFirstIndication(long millis)
Sets the time to wait until the first indication is returned.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).
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(@NonNull NavigationRequest copy)
-
-
Method Detail
-
route
@NonNull public NavigationRequest.Builder route(@NonNull Route route)
Sets theRoute
whose progress is going to be updated.- Parameters:
route
- theroute
to set, so that the methods can be chained together.- Returns:
- a reference to this Builder
-
distanceToChangeFloorThreshold
@NonNull public NavigationRequest.Builder distanceToChangeFloorThreshold(@FloatRange(from=0.0) double distanceToChangeFloorThreshold)
Sets the distance threshold from when a floor change is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_CHANGE_FLOOR
}.- Parameters:
distanceToChangeFloorThreshold
- thedistanceToChangeFloorThreshold
to set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToChangeIndicationThreshold
@NonNull public NavigationRequest.Builder distanceToChangeIndicationThreshold(@FloatRange(from=0.0) 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
- thedistanceToChangeIndicationThreshold
to set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
outsideRouteThreshold
@NonNull public NavigationRequest.Builder outsideRouteThreshold(@FloatRange(from=0.0) double outsideRouteThreshold)
Sets theoutsideRouteThreshold
. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD
}.- Parameters:
outsideRouteThreshold
- theoutsideRouteThreshold
to set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToIgnoreFirstIndication
@NonNull public NavigationRequest.Builder distanceToIgnoreFirstIndication(@FloatRange(from=0.0) 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
- thedistanceToIgnoreFirstIndication
to set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToGoalThreshold
@NonNull public NavigationRequest.Builder distanceToGoalThreshold(@FloatRange(from=0.0) double distanceToGoalThreshold)
Sets the distance threshold from when the goal is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD
}.- Parameters:
distanceToGoalThreshold
- thedistanceToGoalThreshold
to set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
indicationsInterval
@NonNull public NavigationRequest.Builder indicationsInterval(@IntRange(from=0L) long millis)
Sets the time to wait between indications. Default value isNavigationRequest.DEFAULT_INDICATIONS_INTERVAL
milliseconds. 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 theRouteStep
in theNavigationProgress
-
timeToFirstIndication
@NonNull public NavigationRequest.Builder timeToFirstIndication(@IntRange(from=0L) 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_INDICATION
milliseconds. 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.CALCULATING
during that time.
-
roundIndicationsStep
@NonNull public NavigationRequest.Builder roundIndicationsStep(@IntRange(from=0L) 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_STEP
meters. With a value of 0 it won't round indications distance.
-
timeToIgnoreUnexpectedFloorChanges
@NonNull public NavigationRequest.Builder timeToIgnoreUnexpectedFloorChanges(@IntRange(from=0L) 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_CHANGES
With 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.LOW
Location.Quality
will 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, aNavigationProgress
won'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 java.lang.IllegalArgumentException
Returns aNavigationState
with the previously set parameters.- Returns:
NavigationState
- Throws:
java.lang.IllegalArgumentException
-
-