类 DirectionsError

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

public abstract class DirectionsError extends Object implements Serializable
If an InvalidInput error is thrown, this class can be used to get both the code and the message which holds an explanation of the invalid input.
另请参阅:
  • 构造器详细资料

    • DirectionsError

      public DirectionsError()
  • 方法详细资料

    • builder

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

      @Nullable public abstract String code()
      String indicating the state of the response. This is a separate code than the HTTP status code. On normal valid responses, the value will be Ok. The possible responses are listed below:
      • Ok:200 Normal success case
      • NoRoute: 200 There was no route found for the given coordinates. Check for impossible routes (e.g. routes over oceans without ferry connections).
      • NoSegment: 200 No road segment could be matched for coordinates. Check for coordinates too far away from a road.
      • ProfileNotFound: 404 Use a valid profile as described above
      • InvalidInput: 422
      返回:
      a string with one of the given values described in the list above
    • message

      @Nullable public abstract String message()
      Provides a short message with the explanation of the invalid input.
      返回:
      a string containing the message API Directions response
    • toBuilder

      public abstract DirectionsError.Builder toBuilder()
      Convert the current DirectionsError 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 DirectionsError.
      返回:
      a DirectionsError.Builder with the same values set to match the ones defined in this DirectionsError
    • typeAdapter

      public static com.google.gson.TypeAdapter<DirectionsError> 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