-
public final class GraphResponse
Encapsulates the response, successful or otherwise, of a call to the Facebook platform.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
GraphResponse.PagingDirection
Indicates whether paging is being done forward or backward.
public class
GraphResponse.Companion
-
Field Summary
Fields Modifier and Type Field Description private final JSONObject
jsonObject
private final JSONArray
jsonArray
private final GraphRequest
request
private final HttpURLConnection
connection
private final String
rawResponse
private final FacebookRequestError
error
-
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 JSONObject
getJsonObject()
The response returned for this request, if it's in object form. final JSONArray
getJsonArray()
The response returned for this request, if it's in array form. final GraphRequest
getRequest()
final HttpURLConnection
getConnection()
final String
getRawResponse()
final FacebookRequestError
getError()
final JSONObject
getJSONObject()
The response returned for this request, if it's in object form. final JSONArray
getJSONArray()
The response returned for this request, if it's in array form. 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. String
toString()
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
-
-
-
-