-
- 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
Nested Classes Modifier and Type Class Description public interfaceGraphRequestBatch.CallbackSpecifies 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.OnProgressCallbackSpecifies 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
Fields Modifier and Type Field Description private HandlercallbackHandlerprivate final Stringidprivate List<GraphRequest>requestsprivate List<GraphRequestBatch.Callback>callbacksprivate Integertimeoutprivate StringbatchApplicationIdprivate final Integersizeprivate final IntegermodCount
-
Constructor Summary
Constructors Constructor Description GraphRequestBatch()Constructor. GraphRequestBatch(Collection<GraphRequest> requests)Constructor. GraphRequestBatch(GraphRequest requests)Constructor. GraphRequestBatch(GraphRequestBatch requests)Constructor.
-
Method Summary
Modifier and Type Method Description 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 Handler getCallbackHandler()
-
setCallbackHandler
final Unit setCallbackHandler(Handler callbackHandler)
-
getRequests
final List<GraphRequest> getRequests()
The graph requests in this batch.
-
setRequests
final Unit setRequests(List<GraphRequest> requests)
-
getCallbacks
final List<GraphRequestBatch.Callback> getCallbacks()
The callbacks that attached to this batch.
-
setCallbacks
final Unit setCallbacks(List<GraphRequestBatch.Callback> callbacks)
-
getTimeout
final Integer getTimeout()
-
setTimeout
final Unit setTimeout(Integer timeout)
-
getBatchApplicationId
final String getBatchApplicationId()
Batch application id.
-
setBatchApplicationId
final Unit setBatchApplicationId(String batchApplicationId)
Batch application id.
-
addCallback
final Unit addCallback(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 Unit removeCallback(GraphRequestBatch.Callback callback)
Removes a batch-level callback.
- Parameters:
callback- the callback
-
add
Boolean add(GraphRequest element)
-
add
Unit add(Integer index, GraphRequest element)
-
get
GraphRequest get(Integer index)
-
removeAt
GraphRequest removeAt(Integer index)
-
set
GraphRequest set(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 GraphRequestAsyncTask executeAsync()
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.
-
-
-
-