Android SDK Version
All Implemented Interfaces:
kotlin.collections.Collection , kotlin.collections.Iterable , kotlin.collections.List , kotlin.collections.MutableCollection , kotlin.collections.MutableIterable , kotlin.collections.MutableList


public final class GraphRequestBatch
extends AbstractList<GraphRequest>
                    
RequestBatch contains a list of Request objects that can be sent to Facebook in a single round-trip.
Nested Class Summary
Modifier and TypeClassDescription
public interfaceGraphRequestBatch.Callback
Specifies the interface that consumers of the RequestBatch class can implement in order to be notified when the entire batch completes execution. It will be called after all per-Request callbacks are called.
public interfaceGraphRequestBatch.OnProgressCallback
Specifies the interface that consumers of the RequestBatch class can implement in order to be notified when the batch makes progress. The frequency of the callbacks can be controlled using FacebookSdk.setOnProgressThreshold.
public classGraphRequestBatch.Companion
Field Summary
Modifier and TypeFieldDescription
private HandlercallbackHandler
private final Stringid
private List<GraphRequest>requests
private List<GraphRequestBatch.Callback>callbacks
private Integertimeout
private StringbatchApplicationId
private final Integersize
private final IntegermodCount
Constructor Summary
ConstructorDescription
GraphRequestBatch()Constructor.
GraphRequestBatch(Collection<GraphRequest> requests)Constructor.
GraphRequestBatch(GraphRequest requests)Constructor.
GraphRequestBatch(GraphRequestBatch requests)Constructor.
Method Summary
Modifier and TypeMethodDescription
final HandlergetCallbackHandler()
final UnitsetCallbackHandler(Handler callbackHandler)
final StringgetId()
final List<GraphRequest>getRequests() The graph requests in this batch.
final UnitsetRequests(List<GraphRequest> requests)
final List<GraphRequestBatch.Callback>getCallbacks() The callbacks that attached to this batch.
final UnitsetCallbacks(List<GraphRequestBatch.Callback> callbacks)
final IntegergetTimeout()
final UnitsetTimeout(Integer timeout)
final StringgetBatchApplicationId() Batch application id.
final UnitsetBatchApplicationId(String batchApplicationId) Batch application id.
IntegergetSize()
final UnitaddCallback(GraphRequestBatch.Callback callback) Adds a batch-level callback which will be called when the entire batch has finished executing.
final UnitremoveCallback(GraphRequestBatch.Callback callback) Removes a batch-level callback.
Booleanadd(GraphRequest element)
Unitadd(Integer index, GraphRequest element)
Unitclear()
GraphRequestget(Integer index)
GraphRequestremoveAt(Integer index)
GraphRequestset(Integer index, GraphRequest element)
final List<GraphResponse>executeAndWait() Executes this batch on the current thread and returns the responses.
final GraphRequestAsyncTaskexecuteAsync() Executes this batch asynchronously.
Methods inherited from class com.facebook.GraphRequestBatch
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractList
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, toArray, toArray, toString
Methods inherited from class kotlin.collections.Collection
forEach
Methods inherited from class kotlin.collections.MutableCollection
parallelStream, spliterator, stream
Methods inherited from class java.util.AbstractCollection
removeIf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

GraphRequestBatch

GraphRequestBatch()
Constructor.

GraphRequestBatch

GraphRequestBatch(Collection<GraphRequest> requests)
Constructor.
Parameters:
requests - the requests to add to the batch

GraphRequestBatch

GraphRequestBatch(GraphRequest requests)
Constructor.
Parameters:
requests - the requests to add to the batch

GraphRequestBatch

GraphRequestBatch(GraphRequestBatch requests)
Constructor.
Parameters:
requests - the requests to add to the batch
Method Detail

getCallbackHandler

 final HandlergetCallbackHandler()

setCallbackHandler

 final UnitsetCallbackHandler(Handler callbackHandler)

getId

 final StringgetId()

getRequests

 final List<GraphRequest> getRequests()
The graph requests in this batch.

setRequests

 final UnitsetRequests(List<GraphRequest> requests)

getCallbacks

 final List<GraphRequestBatch.Callback> getCallbacks()
The callbacks that attached to this batch.

setCallbacks

 final UnitsetCallbacks(List<GraphRequestBatch.Callback> callbacks)

getTimeout

 final IntegergetTimeout()

setTimeout

 final UnitsetTimeout(Integer timeout)

getBatchApplicationId

 final StringgetBatchApplicationId()
Batch application id.

setBatchApplicationId

 final UnitsetBatchApplicationId(String batchApplicationId)
Batch application id.

addCallback

 final UnitaddCallback(GraphRequestBatch.Callback callback)
Adds a batch-level callback which will be called when the entire batch has finished executing.
Parameters:
callback - the callback

removeCallback

 final UnitremoveCallback(GraphRequestBatch.Callback callback)
Removes a batch-level callback.
Parameters:
callback - the callback

add

Unitadd(Integer index, GraphRequest element)

clear

Unitclear()

set

GraphRequestset(Integer index, GraphRequest element)

executeAndWait

 final List<GraphResponse> executeAndWait()
Executes this batch on the current thread and returns the responses.
This should only be used if you have transitioned off the UI thread.

executeAsync

 final GraphRequestAsyncTaskexecuteAsync()
Executes this batch asynchronously. This function will return immediately, and the batch will be processed on a separate thread. In order to process results of a request, or determine whether a request succeeded or failed, a callback must be specified (see GraphRequest.setCallback)
This should only be called from the UI thread.