Response
最新版本的 SDK 已不再提供此課程。
有此級別的更新版本。前往查看 最新版本。

Encapsulates the response, successful or otherwise, of a call to the Facebook platform.

延伸:Object
套件:facebook
執行個體方法
getError()

Returns information about any errors that may have occurred during the request.

public final FacebookRequestError getError()
Returns
The error from the server, or null if there was no server error
getGraphObject()

The single graph object returned for this request, if any.

public final GraphObject getGraphObject()
Returns
The graph object returned, or null if none was returned (or if the result was a list)
getGraphObjectAs(Class)

The single graph object returned for this request, if any, cast into a particular type of GraphObject.

public final GraphObject getGraphObjectAs(Class graphObjectClass)
參數說明
graphObjectClassThe GraphObject-derived interface to cast the graph object into
Returns
The graph object returned, or null if none was returned (or if the result was a list)
getGraphObjectList()

The list of graph objects returned for this request, if any.

public final GraphObjectList getGraphObjectList()
Returns
The list of graph objects returned, or null if none was returned (or if the result was not a list)
getGraphObjectListAs(Class)

The list of graph objects returned for this request, if any, cast into a particular type of GraphObject.

public final GraphObjectList getGraphObjectListAs(Class graphObjectClass)
參數說明
graphObjectClassThe GraphObject-derived interface to cast the graph objects into
Returns
The list of graph objects returned, or null if none was returned (or if the result was not a list)
getConnection()

Returns the HttpURLConnection that this response was generated from. If the response was retrieved from the cache, this will be null.

public final HttpURLConnection getConnection()
Returns
The connection, or null
getRequest()

Returns the request that this response is for.

public Request getRequest()
Returns
The request that this response is for
getRequestForPagedResults(PagingDirection)

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.

public Request getRequestForPagedResults(PagingDirection direction)
參數說明
directionEnum indicating whether to page forward or backward
Returns
A Request that will retrieve the next page of results in the desired direction, or null if no paging information is available
getIsFromCache()

Indicates whether the response was retrieved from a local cache or from the server.

public final boolean getIsFromCache()
Returns
True if the response was cached locally, false if it was retrieved from the server
常數
NON_JSON_RESPONSE_PROPERTY
Property name of non-JSON results in the GraphObject. Certain calls to Facebook result in a non-JSON response (e.g., the string literal "true" or "false"). To present a consistent way of accessing results, these are represented as a GraphObject with a single string property with this name.
public static final String NON_JSON_RESPONSE_PROPERTY