com.facebook.internal.Validate.notEmptyAndContainsNoNulls()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.facebook.internal.Validate.notEmptyAndContainsNoNulls()方法的一些代码示例,展示了Validate.notEmptyAndContainsNoNulls()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Validate.notEmptyAndContainsNoNulls()方法的具体详情如下:
包路径:com.facebook.internal.Validate
类名称:Validate
方法名:notEmptyAndContainsNoNulls

Validate.notEmptyAndContainsNoNulls介绍

暂无

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * 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<GraphRequest> requests) {
  Validate.notEmptyAndContainsNoNulls(requests, "requests");
  return toHttpConnection(new GraphRequestBatch(requests));
}

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * 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 GraphRequestAsyncTask executeBatchAsync(GraphRequestBatch requests) {
  Validate.notEmptyAndContainsNoNulls(requests, "requests");
  GraphRequestAsyncTask asyncTask = new GraphRequestAsyncTask(requests);
  asyncTask.executeOnExecutor(FacebookSdk.getExecutor());
  return asyncTask;
}

代码示例来源:origin: facebook/facebook-android-sdk

Validate.notEmptyAndContainsNoNulls(requests, "requests");

代码示例来源:origin: fr.avianey/facebook-android-api

/**
 * 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;
}

代码示例来源:origin: fr.avianey/facebook-android-api

/**
 * 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));
}

代码示例来源:origin: fr.avianey/facebook-android-api

/**
 * Executes requests on the current thread as a single batch and returns the responses.
 * <p/>
 * This should only be used if you have transitioned off the UI thread.
 *
 * @param requests
 *            the batch of Requests to execute
 *
 * @return a list of Response objects representing the results of the requests; responses are returned in the same
 *         order as the requests were specified.
 *
 * @throws FacebookException
 *            If there was an error in the protocol used to communicate with the service
 * @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 List<Response> executeBatchAndWait(RequestBatch requests) {
  Validate.notEmptyAndContainsNoNulls(requests, "requests");
  HttpURLConnection connection = null;
  try {
    connection = toHttpConnection(requests);
  } catch (Exception ex) {
    List<Response> responses = Response.constructErrorResponses(requests.getRequests(), null, new FacebookException(ex));
    runCallbacks(requests, responses);
    return responses;
  }
  List<Response> responses = executeConnectionAndWait(connection, requests);
  return responses;
}

相关文章