类 VoiceInstructions

java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.VoiceInstructions
所有已实现的接口:
Serializable

public abstract class VoiceInstructions extends DirectionsJsonObject
This class provides information thats useful for properly making navigation announcements at the correct time. Essentially, a distance and a string are given, using Turf Distance measurement methods you can measure the users current location to the next steps maneuver point and if the measured distance is less than the one the API provides, the announcement should be made.
另请参阅:
  • 构造器详细资料

    • VoiceInstructions

      public VoiceInstructions()
  • 方法详细资料

    • builder

      public static VoiceInstructions.Builder builder()
      Create a new instance of this class by using the VoiceInstructions.Builder class.
      返回:
      this classes VoiceInstructions.Builder for creating a new instance
    • distanceAlongGeometry

      @Nullable public abstract Double distanceAlongGeometry()
      This provides the missing piece in which is needed to announce instructions at accurate times. If the user is less distance away from the maneuver than what this distanceAlongGeometry() than, the announcement should be called.
      返回:
      double value representing the distance to next maneuver in unit meters
    • announcement

      @Nullable public abstract String announcement()
      Provides the instruction string which was build on the server-side and can sometimes concatenate instructions together if maneuver instructions are too close to each other.
      返回:
      a string with the readable instructions ready to be read or displayed to a user
    • ssmlAnnouncement

      @Nullable public abstract String ssmlAnnouncement()
      Get the same instruction string you'd get from announcement() but this one includes Speech Synthesis Markup Language which helps voice synthesiser read information more humanely.
      返回:
      a string with the SSML instructions
    • toBuilder

      public abstract VoiceInstructions.Builder toBuilder()
      Convert the current VoiceInstructions to its builder holding the currently assigned values. This allows you to modify a single property and then rebuild the object resulting in an updated and modified VoiceInstructions.
      返回:
      a VoiceInstructions.Builder with the same values set to match the ones defined in this VoiceInstructions
    • typeAdapter

      public static com.google.gson.TypeAdapter<VoiceInstructions> typeAdapter(com.google.gson.Gson gson)
      Gson type adapter for parsing Gson to this class.
      参数:
      gson - the built Gson object
      返回:
      the type adapter for this class
    • fromJson

      public static VoiceInstructions fromJson(String json)
      Create a new instance of this class by passing in a formatted valid JSON String.
      参数:
      json - a formatted valid JSON string defining a VoiceInstructions
      返回:
      a new instance of this class defined by the values passed inside this static factory method