Android SDK Version


public final class GraphResponse
Encapsulates the response, successful or otherwise, of a call to the Facebook platform.
Nested Class Summary
Modifier and TypeClassDescription
public enumGraphResponse.PagingDirection
Indicates whether paging is being done forward or backward.
public classGraphResponse.Companion
Field Summary
Modifier and TypeFieldDescription
private final JSONObjectjsonObject
private final JSONArrayjsonArray
private final GraphRequestrequest
private final HttpURLConnectionconnection
private final StringrawResponse
private final FacebookRequestErrorerror
Constructor Summary
ConstructorDescription
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 TypeMethodDescription
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.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 JSONObjectgetJsonObject()
The response returned for this request, if it's in object form. Otherwise it's null

getJsonArray

 final JSONArraygetJsonArray()
The response returned for this request, if it's in array form. Otherwise it's null

getRequest

 final GraphRequestgetRequest()

getConnection

 final HttpURLConnectiongetConnection()

getRawResponse

 final StringgetRawResponse()

getJSONObject

 final JSONObjectgetJSONObject()
The response returned for this request, if it's in object form.

getJSONArray

 final JSONArraygetJSONArray()
The response returned for this request, if it's in array form.

getRequestForPagedResults

 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. If no paging information is available, returns null.
Parameters:
direction - enum indicating whether to page forward or backward

toString

StringtoString()
Provides a debugging string for this response.