Java Code Examples for com.facebook.internal.Validate#notEmptyAndContainsNoNulls()

The following examples show how to use com.facebook.internal.Validate#notEmptyAndContainsNoNulls() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Request.java    From platform-friends-android with BSD 2-Clause "Simplified" License 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 2
Source File: Request.java    From Klyph with MIT License 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 3
Source File: Request.java    From barterli_android with Apache License 2.0 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 4
Source File: Request.java    From aws-mobile-self-paced-labs-samples with Apache License 2.0 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 5
Source File: Request.java    From KlyphMessenger with MIT License 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 6
Source File: Request.java    From HypFacebook with BSD 2-Clause "Simplified" License 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 7
Source File: Request.java    From FacebookNewsfeedSample-Android with Apache License 2.0 3 votes vote down vote up
/**
 * Executes requests as a single batch asynchronously. This function will return immediately, and the requests 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 the {@link #setCallback(Callback) setCallback} method).
 * <p/>
 * This should only be called from the UI thread.
 *
 * @param requests
 *            the RequestBatch to execute
 * @return a RequestAsyncTask that is executing the request
 *
 * @throws IllegalArgumentException if the passed in RequestBatch is empty
 * @throws NullPointerException if the passed in RequestBatch or any of its contents are null
 */
public static RequestAsyncTask executeBatchAsync(RequestBatch requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    RequestAsyncTask asyncTask = new RequestAsyncTask(requests);
    asyncTask.executeOnSettingsExecutor();
    return asyncTask;
}
 
Example 8
Source File: Request.java    From platform-friends-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 9
Source File: Request.java    From Klyph with MIT License 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 10
Source File: Request.java    From barterli_android with Apache License 2.0 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 11
Source File: Request.java    From aws-mobile-self-paced-labs-samples with Apache License 2.0 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 12
Source File: Request.java    From KlyphMessenger with MIT License 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 13
Source File: Request.java    From HypFacebook with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}
 
Example 14
Source File: Request.java    From FacebookNewsfeedSample-Android with Apache License 2.0 2 votes vote down vote up
/**
 * Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed
 * explicitly by the caller.
 *
 * @param requests
 *            one or more Requests to serialize
 * @return an HttpURLConnection which is ready to execute
 *
 * @throws FacebookException
 *            If any of the requests in the batch are badly constructed or if there are problems
 *            contacting the service
 * @throws IllegalArgumentException if the passed in collection is empty
 * @throws NullPointerException if the passed in collection or any of its contents are null
 */
public static HttpURLConnection toHttpConnection(Collection<Request> requests) {
    Validate.notEmptyAndContainsNoNulls(requests, "requests");

    return toHttpConnection(new RequestBatch(requests));
}