Waypoint

public final class Waypoint extends Object

An immutable waypoint class, used to specify navigation destinations. It may be constructed from a latitude/longitude pair, or a Google Place ID.

Nested Class Summary

class Waypoint.Builder A Builder class to construct instances of Waypoint. 
class Waypoint.InvalidSegmentHeadingException An exception thrown when trying to create a Waypoint with an invalid segment heading. 
class Waypoint.UnsupportedPlaceIdException An exception thrown when trying to create a Waypoint from an unsupported Place ID. 

Public Method Summary

static Waypoint.Builder
builder()
Returns a new Builder instance that allows building new Waypoint objects.
boolean
equals(Object o)
Tests if this Waypoint is equal to another.
String
getPlaceId()
Returns the place id of the waypoint.
LatLng
getPosition()
Returns the lat/lng position of the waypoint if it has been set, otherwise it returns null.
boolean
getPreferSameSideOfRoad()
Returns whether it is preferred to route the driver to the same side of the road.
int
getPreferredHeading()
Returns an angle used to express the direction of traffic on the side of the road that the vehicle should arrive on.
String
getTitle()
Returns the title of the Waypoint.
boolean
getVehicleStopover()
Indicates whether the waypoint can be relocated to a nearby place if its location is not suitable for a vehicle to make a stop.
int
static Waypoint.Builder
toBuilder(Waypoint waypoint)
Creates a new Builder instance based on an existing Waypoint object.
String

Inherited Method Summary

Public Methods

public static Waypoint.Builder builder ()

Returns a new Builder instance that allows building new Waypoint objects.

Returns
  • a new Builder instance.

public boolean equals (Object o)

Tests if this Waypoint is equal to another.

The Waypoints are considered equal if they both represent the same destination. (All attributes set on the Waypoint must be equivalent.)

Parameters
o

public String getPlaceId ()

Returns the place id of the waypoint.

public LatLng getPosition ()

Returns the lat/lng position of the waypoint if it has been set, otherwise it returns null.

public boolean getPreferSameSideOfRoad ()

Returns whether it is preferred to route the driver to the same side of the road.

Returns
  • a boolean indicating whether the same side of the road is preferred.

public int getPreferredHeading ()

Returns an angle used to express the direction of traffic on the side of the road that the vehicle should arrive on.

Returns
  • the value of the angle expressed in degrees [0, 360], where 0 means North. Returns a negative value if the angle is unset.

public String getTitle ()

Returns the title of the Waypoint. The title is the text that is displayed for the Waypoint in the notification tray.

Returns
  • the title of the waypoint

public boolean getVehicleStopover ()

Indicates whether the waypoint can be relocated to a nearby place if its location is not suitable for a vehicle to make a stop. Elevated areas, ferries, underground locations and areas of limited access will be relocated to a nearby safe location.

Returns
  • a boolean indicating whether vehicleStopover has been enabled.

public int hashCode ()

public static Waypoint.Builder toBuilder (Waypoint waypoint)

Creates a new Builder instance based on an existing Waypoint object.

Parameters
waypoint the Waypoint object whose attributes will be used to populate the attributes of a new Builder instance.
Returns
  • a new Waypoint.Builder instance containing the attributes of the waypoint passed.

public String toString ()