public class ReachabilityResponse extends Object
| Constructor and Description |
|---|
ReachabilityResponse(TravelOptions travelOptions,
org.json.JSONObject result,
long requestStart)
Create a response from JSON results, using given travel options
|
ReachabilityResponse(TravelOptions travelOptions,
String code,
long requestTime,
long requestStart)
Create a response with custom response code and without results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClosestSource(String targetId,
String closestSourceId) |
void |
addTravelTime(String targetId,
Integer travelTime)
Add travel time to a target
|
String |
getClosestSourceForTarget(String targetId) |
Map<String,String> |
getClosestSourceIds()
Map of target IDs to the individual closest source ID
|
String |
getCode() |
long |
getRequestTimeMillis() |
long |
getTotalTime()
Get total time in milliseconds
|
TravelOptions |
getTravelOptions() |
Map<String,Integer> |
getTravelTimes()
Map of source IDs - travel times
|
void |
mapResults(org.json.JSONObject result)
Parse results in JSON to travel times map.
|
public ReachabilityResponse(TravelOptions travelOptions, org.json.JSONObject result, long requestStart)
travelOptions - travel options, from the requestresult - Travel times in JSONrequestStart - Start time of executionpublic ReachabilityResponse(TravelOptions travelOptions, String code, long requestTime, long requestStart)
travelOptions - Travel options used in requestcode - Response coderequestTime - Execution time in millisecondsrequestStart - Start time of executionpublic void mapResults(org.json.JSONObject result)
result - resulting JSONpublic void addTravelTime(String targetId, Integer travelTime)
targetId - Target IDtravelTime - Travel time for the targetpublic String getCode()
public long getRequestTimeMillis()
public TravelOptions getTravelOptions()
public Map<String,Integer> getTravelTimes()
public Map<String,String> getClosestSourceIds()
public long getTotalTime()
Copyright © 2017. All rights reserved.