类 DirectionsError
java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsError
- 所有已实现的接口:
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.
- 另请参阅:
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static DirectionsError.Builderbuilder()Create a new instance of this class by using theDirectionsError.Builderclass.abstract Stringcode()String indicating the state of the response.abstract Stringmessage()Provides a short message with the explanation of the invalid input.abstract DirectionsError.BuilderConvert the currentDirectionsErrorto its builder holding the currently assigned values.static com.google.gson.TypeAdapter<DirectionsError>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.
-
构造器详细资料
-
DirectionsError
public DirectionsError()
-
-
方法详细资料
-
builder
Create a new instance of this class by using theDirectionsError.Builderclass.- 返回:
- this classes
DirectionsError.Builderfor creating a new instance
-
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
Provides a short message with the explanation of the invalid input.- 返回:
- a string containing the message API Directions response
-
toBuilder
Convert the currentDirectionsErrorto 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 modifiedDirectionsError.- 返回:
- a
DirectionsError.Builderwith the same values set to match the ones defined in thisDirectionsError
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-