-
- 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 interface
GraphRequestBatch.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 interface
GraphRequestBatch.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 class
GraphRequestBatch.Companion
-
Field Summary
Fields Modifier and Type Field Description private Handler
callbackHandler
private final String
id
private List<GraphRequest>
requests
private List<GraphRequestBatch.Callback>
callbacks
private Integer
timeout
private String
batchApplicationId
private final Integer
size
private final Integer
modCount
-
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 Handler
getCallbackHandler()
final Unit
setCallbackHandler(Handler callbackHandler)
final String
getId()
final List<GraphRequest>
getRequests()
The graph requests in this batch. final Unit
setRequests(List<GraphRequest> requests)
final List<GraphRequestBatch.Callback>
getCallbacks()
The callbacks that attached to this batch. final Unit
setCallbacks(List<GraphRequestBatch.Callback> callbacks)
final Integer
getTimeout()
final Unit
setTimeout(Integer timeout)
final String
getBatchApplicationId()
Batch application id. final Unit
setBatchApplicationId(String batchApplicationId)
Batch application id. Integer
getSize()
final Unit
addCallback(GraphRequestBatch.Callback callback)
Adds a batch-level callback which will be called when the entire batch has finished executing. final Unit
removeCallback(GraphRequestBatch.Callback callback)
Removes a batch-level callback. Boolean
add(GraphRequest element)
Unit
add(Integer index, GraphRequest element)
Unit
clear()
GraphRequest
get(Integer index)
GraphRequest
removeAt(Integer index)
GraphRequest
set(Integer index, GraphRequest element)
final List<GraphResponse>
executeAndWait()
Executes this batch on the current thread and returns the responses. final GraphRequestAsyncTask
executeAsync()
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.
-
-
-
-