Tabnine Logo
AVQuery.getFirstInBackground
Code IndexAdd Tabnine to your IDE (free)

How to use
getFirstInBackground
method
in
com.avos.avoscloud.AVQuery

Best Java code snippets using com.avos.avoscloud.AVQuery.getFirstInBackground (Showing top 4 results out of 315)

origin: cn.leancloud.android/avoscloud-sdk

/**
 * Retrieves at most one AVObject that satisfies this query from the server in a background
 * thread. This is preferable to using getFirst(), unless your code is already running in a
 * background thread. This mutates the AVQuery.
 *
 * @param callback callback.done(object, e) is called when the find completes.
 */
public void getFirstInBackground(GetCallback<T> callback) {
 getFirstInBackground(false, callback);
}
origin: cn.leancloud/leancloud-common

/**
 * Retrieves at most one AVObject that satisfies this query from the server in a background
 * thread. This is preferable to using getFirst(), unless your code is already running in a
 * background thread. This mutates the AVQuery.
 *
 * @param callback callback.done(object, e) is called when the find completes.
 */
public void getFirstInBackground(GetCallback<T> callback) {
 getFirstInBackground(false, callback);
}
origin: cn.leancloud/leancloud-common

/**
 * Retrieves at most one AVObject that satisfies this query. Uses the network and/or the cache,
 * depending on the cache policy. This mutates the AVQuery.
 *
 * @return A AVObject obeying the conditions set in this query, or null if none found.
 */
@SuppressWarnings("unchecked")
public T getFirst() throws AVException {
 final Object[] result = {null};
 getFirstInBackground(true, new GetCallback<T>() {
  @Override
  public void done(AVObject object, AVException e) {
   if (e == null) {
    result[0] = object;
   } else {
    AVExceptionHolder.add(e);
   }
  }
  @Override
  protected boolean mustRunOnUIThread() {
   return false;
  }
 });
 if (AVExceptionHolder.exists()) {
  throw AVExceptionHolder.remove();
 }
 return (T) result[0];
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * Retrieves at most one AVObject that satisfies this query. Uses the network and/or the cache,
 * depending on the cache policy. This mutates the AVQuery.
 *
 * @return A AVObject obeying the conditions set in this query, or null if none found.
 */
@SuppressWarnings("unchecked")
public T getFirst() throws AVException {
 final Object[] result = {null};
 getFirstInBackground(true, new GetCallback<T>() {
  @Override
  public void done(AVObject object, AVException e) {
   if (e == null) {
    result[0] = object;
   } else {
    AVExceptionHolder.add(e);
   }
  }
  @Override
  protected boolean mustRunOnUIThread() {
   return false;
  }
 });
 if (AVExceptionHolder.exists()) {
  throw AVExceptionHolder.remove();
 }
 return (T) result[0];
}
com.avos.avoscloudAVQuerygetFirstInBackground

Javadoc

Retrieves at most one AVObject that satisfies this query from the server in a background thread. This is preferable to using getFirst(), unless your code is already running in a background thread. This mutates the AVQuery.

Popular methods of AVQuery

  • whereEqualTo
    Add a constraint to the query that requires a particular key's value to be equal to the provided val
  • <init>
  • findInBackground
    Retrieves a list of AVObjects that satisfy this query from the server in a background thread. This i
  • setLimit
    Controls the maximum number of results that are returned. Setting a negative limit denotes retrieval
  • assembleParameters
  • getClassName
    Accessor for the class name.
  • countInBackground
  • doCloudQueryInBackground
    通过cql查询对象
  • find
    Retrieves a list of AVObjects that satisfy this query. Uses the network and/or the cache, depending
  • whereNotContainedIn
    Add a constraint to the query that requires a particular key's value not be contained in the provide
  • addAndItems
  • addOrItems
  • addAndItems,
  • addOrItems,
  • addWhereItem,
  • doCloudQuery,
  • generateQueryPath,
  • get,
  • getInBackground,
  • getInclude,
  • getLimit

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now