Package es.situm.sdk.directions
Class DirectionsRequest.Builder
- java.lang.Object
-
- es.situm.sdk.directions.DirectionsRequest.Builder
-
- Enclosing class:
- DirectionsRequest
public static final class DirectionsRequest.Builder extends java.lang.Object
DirectionsRequest
builder static inner class.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(DirectionsRequest copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectionsRequest.Builder
accessibilityMode(DirectionsRequest.AccessibilityMode accessibilityMode)
Sets the accessibility mode of the route.DirectionsRequest
build()
Returns aDirectionsRequest
built from the parameters previously set.DirectionsRequest.Builder
excludedTags(java.util.List<java.lang.String> excludedTags)
List of tags that you want your route to avoid.DirectionsRequest.Builder
excluding(Circle exclusion)
Add an area that will be excluded from the calculated route.DirectionsRequest.Builder
from(Point from, Angle bearingFrom)
Sets the starting point of the route, and the bearing of the user to generate the appropriate instructions.DirectionsRequest.Builder
from(Location currentLocation)
Sets the current user's position as the starting point of the route.DirectionsRequest.Builder
includedTags(java.util.List<java.lang.String> includedTags)
List of tags that you want to use when calculating a route.DirectionsRequest.Builder
isAccessible(boolean isAccessible)
Sets if the route has to be suitable for wheel chairs (true) or not (false)DirectionsRequest.Builder
minimizeFloorChanges(boolean minimizeFloorChanges)
Sets if you want to calculate a route minimizing the floor changes even if the route is longer.DirectionsRequest.Builder
options(DirectionsOptions options)
Sets additional information on how a route should be computed.DirectionsRequest.Builder
to(Point to)
Sets the pointto
, where the route should end.DirectionsRequest.Builder
to(java.lang.String poiToIdentifier)
Sets the identifier of the POIpoiToIdentifier
, where the route should end.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(@NonNull DirectionsRequest copy)
-
-
Method Detail
-
from
@NonNull public DirectionsRequest.Builder from(@NonNull Point from, @NonNull Angle bearingFrom)
Sets the starting point of the route, and the bearing of the user to generate the appropriate instructions.- Parameters:
from
-Point
point inside a building (Point.isIndoor()
== true)bearingFrom
-Angle
user's bearing- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
from
@NonNull public DirectionsRequest.Builder from(@NonNull Location currentLocation)
Sets the current user's position as the starting point of the route.- Parameters:
currentLocation
- current user'sLocation
, obtained withLocationManager
- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
to
@NonNull public DirectionsRequest.Builder to(@NonNull Point to)
Sets the pointto
, where the route should end.- Parameters:
to
-Point
point inside a building (Point.isIndoor()
== true)- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
to
@NonNull public DirectionsRequest.Builder to(@NonNull java.lang.String poiToIdentifier)
Sets the identifier of the POIpoiToIdentifier
, where the route should end.- Parameters:
poiToIdentifier
-String
Identifier of a POI inside a building (Poi.isIndoor()
== true)- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
isAccessible
@NonNull public DirectionsRequest.Builder isAccessible(boolean isAccessible)
Sets if the route has to be suitable for wheel chairs (true) or not (false)- Parameters:
isAccessible
- boolean- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
accessibilityMode
@NonNull public DirectionsRequest.Builder accessibilityMode(DirectionsRequest.AccessibilityMode accessibilityMode)
Sets the accessibility mode of the route.Default value is
DirectionsRequest.DEFAULT_ACCESSIBILITY_MODE
- Parameters:
accessibilityMode
-DirectionsRequest.AccessibilityMode
- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
minimizeFloorChanges
public DirectionsRequest.Builder minimizeFloorChanges(boolean minimizeFloorChanges)
Sets if you want to calculate a route minimizing the floor changes even if the route is longer. By default this is set to false, and it will calculate the shortest route.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
includedTags
public DirectionsRequest.Builder includedTags(java.util.List<java.lang.String> includedTags)
List of tags that you want to use when calculating a route. Only the tags added here will be used. Other tags on the graph will be excluded. The edges without a tag will always be used. If you don't include or exclude any tags the entire graph will be used to calculate the route.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
excludedTags
public DirectionsRequest.Builder excludedTags(java.util.List<java.lang.String> excludedTags)
List of tags that you want your route to avoid. If you exclude a tag the route will never pass through an edge that has this tag. If the route can only be generated passing through an edge with this tags the route calculation will fail.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
options
public DirectionsRequest.Builder options(DirectionsOptions options)
Sets additional information on how a route should be computed.- Parameters:
options
-DirectionsOptions
instance- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
excluding
public DirectionsRequest.Builder excluding(Circle exclusion)
Add an area that will be excluded from the calculated route. The route will never contain a path that collides with the given circle. For example:DirectionsRequest request = new DirectionsRequest.Builder() .from(...) .to(...) .excluding(new Circle(center, radius)) .build();
Call this method as many times as you need to exclude multiple areas.
If the given circle contains the beginning/end point of the route then an error 3061 will be generated and forwarded to your handler at
DirectionsManager.requestDirections(DirectionsRequest, Handler)
.- Parameters:
exclusion
- TheCircle
to be excluded.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
build
@NonNull public DirectionsRequest build()
Returns aDirectionsRequest
built from the parameters previously set.- Returns:
- a
DirectionsRequest
built with parameters of thisDirectionsRequest.Builder
-
-