-
public final class GraphResponseEncapsulates the response, successful or otherwise, of a call to the Facebook platform.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumGraphResponse.PagingDirectionIndicates whether paging is being done forward or backward.
public classGraphResponse.Companion
-
Field Summary
Fields Modifier and Type Field Description private final JSONObjectjsonObjectprivate final JSONArrayjsonArrayprivate final GraphRequestrequestprivate final HttpURLConnectionconnectionprivate final StringrawResponseprivate final FacebookRequestErrorerror
-
Constructor Summary
Constructors Constructor Description GraphResponse(GraphRequest request, HttpURLConnection connection, String rawResponse, JSONObject graphObject)GraphResponse(GraphRequest request, HttpURLConnection connection, String rawResponse, JSONArray graphObjects)GraphResponse(GraphRequest request, HttpURLConnection connection, FacebookRequestError error)
-
Method Summary
Modifier and Type Method Description final JSONObjectgetJsonObject()The response returned for this request, if it's in object form. final JSONArraygetJsonArray()The response returned for this request, if it's in array form. final GraphRequestgetRequest()final HttpURLConnectiongetConnection()final StringgetRawResponse()final FacebookRequestErrorgetError()final JSONObjectgetJSONObject()The response returned for this request, if it's in object form. final JSONArraygetJSONArray()The response returned for this request, if it's in array form. final GraphRequestgetRequestForPagedResults(GraphResponse.PagingDirection direction)If a Response contains results that contain paging information, returns a new Request that will retrieve the next page of results, in whichever direction is desired. StringtoString()Provides a debugging string for this response. -
-
Constructor Detail
-
GraphResponse
GraphResponse(GraphRequest request, HttpURLConnection connection, String rawResponse, JSONObject graphObject)
-
GraphResponse
GraphResponse(GraphRequest request, HttpURLConnection connection, String rawResponse, JSONArray graphObjects)
-
GraphResponse
GraphResponse(GraphRequest request, HttpURLConnection connection, FacebookRequestError error)
-
-
Method Detail
-
getJsonObject
final JSONObject getJsonObject()
The response returned for this request, if it's in object form. Otherwise it's null
-
getJsonArray
final JSONArray getJsonArray()
The response returned for this request, if it's in array form. Otherwise it's null
-
getRequest
final GraphRequest getRequest()
-
getConnection
final HttpURLConnection getConnection()
-
getRawResponse
final String getRawResponse()
-
getError
final FacebookRequestError getError()
-
getJSONObject
final JSONObject getJSONObject()
The response returned for this request, if it's in object form.
-
getJSONArray
final JSONArray getJSONArray()
The response returned for this request, if it's in array form.
-
getRequestForPagedResults
final GraphRequest getRequestForPagedResults(GraphResponse.PagingDirection direction)
If a Response contains results that contain paging information, returns a new Request that will retrieve the next page of results, in whichever direction is desired. If no paging information is available, returns null.
- Parameters:
direction- enum indicating whether to page forward or backward
-
-
-
-