public static final class

DirectionsRequest.Builder

extends Object
java.lang.Object
   ↳ com.steerpath.sdk.directions.DirectionsRequest.Builder

Class Overview

Used for creating new DirectionsRequest objects.

Summary

Public Constructors
Builder()
Public Methods
DirectionsRequest.Builder addDestination(Location end, String info)
Used for defining one or more destinations to which a route should be calculated.
DirectionsRequest.Builder addDestination(double lat, double lon, int lvl, String info)
Convenience function to create a Location object with additional information including level and user specified information.
DirectionsRequest.Builder addDestination(Location end)
Add a destination to route to.
DirectionsRequest build()
Create a new DirectionsRequest object based on the configuration done in the builder.
DirectionsRequest.Builder setSource(double lat, double lon, int lvl, String info)
Convenience method for setting the start Location for this directions request.
DirectionsRequest.Builder setSource(Location start)
Set the initial point for the route calculation.
DirectionsRequest.Builder useAccessibility(boolean use)
When using accessibility mode, route avoids stairs and escalators.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Public Methods

public DirectionsRequest.Builder addDestination (Location end, String info)

Used for defining one or more destinations to which a route should be calculated.

Parameters
end the end point to which the route should be calculated.
info additional user specified string which will be stored in Location.setMetaData().
Returns
  • an instance of this builder.

public DirectionsRequest.Builder addDestination (double lat, double lon, int lvl, String info)

Convenience function to create a Location object with additional information including level and user specified information.
If you add multiple destinations, the route calculation will be done to all the given destinations.

Parameters
lat the latitude of this destination
lon the longitude of this destination
lvl the level of the this destination
info any user specific information to be put in the Location object.
Returns
  • an instance of this builder.

public DirectionsRequest.Builder addDestination (Location end)

Add a destination to route to. The extras of the destination should have the LOCATION_LEVEL_KEY set, and may have the LOCATION_META_ID_KEY set.
If you add multiple destinations, the route calculation will be done to all the given destinations.

Parameters
end the end Location of this route.

public DirectionsRequest build ()

Create a new DirectionsRequest object based on the configuration done in the builder. This is the way to obtain a DirectionsRequest object. Throws IllegalArgumentException if no source or destination is set.

Returns
  • a DirectionsRequest object with the given settings.

public DirectionsRequest.Builder setSource (double lat, double lon, int lvl, String info)

Convenience method for setting the start Location for this directions request.

Parameters
lat the latitude of the start point
lon the longitude of the start point
lvl the level of the start point
info any user specific information to be put in the Location object.
Returns
  • an instance of this builder.

public DirectionsRequest.Builder setSource (Location start)

Set the initial point for the route calculation. The Location object will be returned in the solution, so if some meta information needs to be carried through, it can be done by placing it the extras read of the location. The level information if extracted from the LOCATION_LEVEL_KEY.

Returns
  • an instance of this builder.

public DirectionsRequest.Builder useAccessibility (boolean use)

When using accessibility mode, route avoids stairs and escalators. Will use stairs and escalators if destination cannot be otherwise reached.
Disabled by default.