Class RouteInstruction

java.lang.Object
com.azure.maps.route.models.RouteInstruction
All Implemented Interfaces:
com.azure.json.JsonSerializable<RouteInstruction>

public final class RouteInstruction extends Object implements com.azure.json.JsonSerializable<RouteInstruction>
A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of RouteInstruction class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of RouteInstruction from the JsonReader.
    Get the combinedMessage property: A human-readable message for the maneuver combined with the message from the next instruction.
    Get the countryCode property: 3-character [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-3 country code.
    Get the drivingSide property: Indicates left-hand vs. right-hand side driving at the point of the maneuver.
    Get the exitNumber property: The number(s) of a highway exit taken by the current maneuver.
    Get the instructionType property: Type of the instruction, e.g., turn or change of road form.
    Get the junctionType property: The type of the junction where the maneuver takes place.
    Get the maneuver property: A code identifying the maneuver.
    Get the message property: A human-readable message for the maneuver.
    com.azure.core.models.GeoPosition
    Returns the GeoPosition coordinates of this instruction.
    Get the pointIndex property: The index of the point in the list of polyline "points" corresponding to the point of the instruction.
    Get the roadNumbers property: The road number(s) of the next significant road segment(s) after the maneuver, or of the road(s) to be followed.
    Get the roundaboutExitNumber property: This indicates which exit to take at a roundabout.
    Get the routeOffsetInMeters property: Distance from the start of the route to the point of the instruction.
    Get the signpostText property: The text on a signpost which is most relevant to the maneuver, or to the direction that should be followed.
    Get the stateCode property: A subdivision (e.g., state) of the country, represented by the second part of an [ISO 3166-2](https://www.iso.org/standard/63546.html) code.
    Get the street property: Street name of the next significant road segment after the maneuver, or of the street that should be followed.
    Get the travelTimeInSeconds property: Estimated travel time up to the point corresponding to routeOffsetInMeters.
    Get the turnAngleInDegrees property: Indicates the direction of an instruction.
    Get the possibleCombineWithNext property: It is possible to optionally combine the instruction with the next one.
    Set the instructionType property: Type of the instruction, e.g., turn or change of road form.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • RouteInstruction

      public RouteInstruction()
      Creates an instance of RouteInstruction class.
  • Method Details

    • getRouteOffsetInMeters

      public Integer getRouteOffsetInMeters()
      Get the routeOffsetInMeters property: Distance from the start of the route to the point of the instruction.
      Returns:
      the routeOffsetInMeters value.
    • getTravelTimeInSeconds

      public Integer getTravelTimeInSeconds()
      Get the travelTimeInSeconds property: Estimated travel time up to the point corresponding to routeOffsetInMeters.
      Returns:
      the travelTimeInSeconds value.
    • getPoint

      public com.azure.core.models.GeoPosition getPoint()
      Returns the GeoPosition coordinates of this instruction.
      Returns:
      a GeoPosition with the coordinates of this instruction.
    • getPointIndex

      public Integer getPointIndex()
      Get the pointIndex property: The index of the point in the list of polyline "points" corresponding to the point of the instruction.
      Returns:
      the pointIndex value.
    • getInstructionType

      public GuidanceInstructionType getInstructionType()
      Get the instructionType property: Type of the instruction, e.g., turn or change of road form.
      Returns:
      the instructionType value.
    • setInstructionType

      public RouteInstruction setInstructionType(GuidanceInstructionType instructionType)
      Set the instructionType property: Type of the instruction, e.g., turn or change of road form.
      Parameters:
      instructionType - the instructionType value to set.
      Returns:
      the RouteInstruction object itself.
    • getRoadNumbers

      public List<String> getRoadNumbers()
      Get the roadNumbers property: The road number(s) of the next significant road segment(s) after the maneuver, or of the road(s) to be followed. Example: ["E34", "N205"].
      Returns:
      the roadNumbers value.
    • getExitNumber

      public String getExitNumber()
      Get the exitNumber property: The number(s) of a highway exit taken by the current maneuver. If an exit has multiple exit numbers, they will be separated by "," and possibly aggregated by "-", e.g., "10, 13-15".
      Returns:
      the exitNumber value.
    • getStreet

      public String getStreet()
      Get the street property: Street name of the next significant road segment after the maneuver, or of the street that should be followed.
      Returns:
      the street value.
    • getSignpostText

      public String getSignpostText()
      Get the signpostText property: The text on a signpost which is most relevant to the maneuver, or to the direction that should be followed.
      Returns:
      the signpostText value.
    • getCountryCode

      public String getCountryCode()
      Get the countryCode property: 3-character [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-3 country code. E.g. USA.
      Returns:
      the countryCode value.
    • getStateCode

      public String getStateCode()
      Get the stateCode property: A subdivision (e.g., state) of the country, represented by the second part of an [ISO 3166-2](https://www.iso.org/standard/63546.html) code. This is only available for some countries/regions like the US, Canada, and Mexico.
      Returns:
      the stateCode value.
    • getJunctionType

      public JunctionType getJunctionType()
      Get the junctionType property: The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout.
      Returns:
      the junctionType value.
    • getTurnAngleInDegrees

      public Integer getTurnAngleInDegrees()
      Get the turnAngleInDegrees property: Indicates the direction of an instruction. If junctionType indicates a turn instruction: * 180 = U-turn * [-179, -1] = Left turn * 0 = Straight on (a '0 degree' turn) * [1, 179] = Right turn If junctionType indicates a bifurcation instruction: * <0 - keep left * \>0 - keep right.
      Returns:
      the turnAngleInDegrees value.
    • getRoundaboutExitNumber

      public Long getRoundaboutExitNumber()
      Get the roundaboutExitNumber property: This indicates which exit to take at a roundabout.
      Returns:
      the roundaboutExitNumber value.
    • isPossibleCombineWithNext

      public Boolean isPossibleCombineWithNext()
      Get the possibleCombineWithNext property: It is possible to optionally combine the instruction with the next one. This can be used to build messages like "Turn left and then turn right".
      Returns:
      the possibleCombineWithNext value.
    • getDrivingSide

      public DrivingSide getDrivingSide()
      Get the drivingSide property: Indicates left-hand vs. right-hand side driving at the point of the maneuver.
      Returns:
      the drivingSide value.
    • getManeuver

      public GuidanceManeuver getManeuver()
      Get the maneuver property: A code identifying the maneuver.
      Returns:
      the maneuver value.
    • getMessage

      public String getMessage()
      Get the message property: A human-readable message for the maneuver.
      Returns:
      the message value.
    • getCombinedMessage

      public String getCombinedMessage()
      Get the combinedMessage property: A human-readable message for the maneuver combined with the message from the next instruction. Sometimes it is possible to combine two successive instructions into a single instruction making it easier to follow. When this is the case the possibleCombineWithNext flag will be true. For example: ``` 10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam 11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam ``` The possibleCombineWithNext flag on instruction 10 is true. This indicates to the clients of coded guidance that it can be combined with instruction 11. The instructions will be combined automatically for clients requesting human-readable guidance. The combinedMessage field contains the combined message: ``` Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam then follow Einsteinweg/A10/E22 towards Ring Amsterdam. ```.
      Returns:
      the combinedMessage value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<RouteInstruction>
      Throws:
      IOException
    • fromJson

      public static RouteInstruction fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of RouteInstruction from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of RouteInstruction if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the RouteInstruction.