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

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

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

origin: cn.leancloud/leancloud-common

/**
 * Constructs a AVObject whose id is already known by fetching data from the server in a
 * background thread. This does not use caching. This is preferable to using the
 * AVObject(className, objectId) constructor, unless your code is already running in a background
 * thread.
 *
 * @param objectId Object id of the AVObject to fetch
 * @param callback callback.done(object, e) will be called when the fetch completes.
 */
public void getInBackground(String objectId, GetCallback<T> callback) {
 final GetCallback<T> internalCallback = callback;
 this.getInBackground(objectId, false, new GetCallback<T>() {
  @Override
  public void done(T object, AVException e) {
   if (internalCallback != null) {
    internalCallback.internalDone(object, e);
   }
  }
 });
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * Constructs a AVObject whose id is already known by fetching data from the server in a
 * background thread. This does not use caching. This is preferable to using the
 * AVObject(className, objectId) constructor, unless your code is already running in a background
 * thread.
 *
 * @param objectId Object id of the AVObject to fetch
 * @param callback callback.done(object, e) will be called when the fetch completes.
 */
public void getInBackground(String objectId, GetCallback<T> callback) {
 final GetCallback<T> internalCallback = callback;
 this.getInBackground(objectId, false, new GetCallback<T>() {
  @Override
  public void done(T object, AVException e) {
   if (internalCallback != null) {
    internalCallback.internalDone(object, e);
   }
  }
 });
}
origin: cn.leancloud/leancloud-common

/**
 * Retrieve a AVFile object by object id from AVOSCloud in background.If the file is not found,it
 * will call the callback with java.io.FileNotFoundException.
 *
 * @param objectId The file object id.
 * @param cb The GetFileCallback instance.
 * @since 2.0.2
 */
public static void withObjectIdInBackground(final String objectId,
  final GetFileCallback<AVFile> cb) {
 AVQuery<AVObject> query = new AVQuery<AVObject>("_File");
 query.getInBackground(objectId, new GetCallback<AVObject>() {
  @Override
  public void done(AVObject object, AVException e) {
   if (e != null) {
    cb.internalDone(null, e);
    return;
   }
   if (object != null && !AVUtils.isBlankString(object.getObjectId())) {
    AVFile file = createFileFromAVObject(object);
    if (cb != null) {
     cb.internalDone(file, null);
    }
   } else {
    cb.internalDone(null, new AVException(AVException.OBJECT_NOT_FOUND,
      "Could not find file object by id:" + objectId));
   }
  }
 });
}
origin: cn.leancloud.android/avoscloud-sdk

                     final GetFileCallback<AVFile> cb) {
AVQuery<AVObject> query = new AVQuery<AVObject>("_File");
query.getInBackground(objectId, new GetCallback<AVObject>() {
origin: cn.leancloud/leancloud-common

/**
 * Constructs a AVObject whose id is already known by fetching data from the server. This mutates
 * the AVQuery.
 *
 * @param theObjectId Object id of the AVObject to fetch.
 */
@SuppressWarnings("unchecked")
public T get(String theObjectId) throws AVException {
 final Object[] result = {null};
 this.getInBackground(theObjectId, true, new GetCallback<T>() {
  @Override
  public void done(T 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

/**
 * Constructs a AVObject whose id is already known by fetching data from the server. This mutates
 * the AVQuery.
 *
 * @param theObjectId Object id of the AVObject to fetch.
 */
@SuppressWarnings("unchecked")
public T get(String theObjectId) throws AVException {
 final Object[] result = {null};
 this.getInBackground(theObjectId, true, new GetCallback<T>() {
  @Override
  public void done(T 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.avoscloudAVQuerygetInBackground

Javadoc

Constructs a AVObject whose id is already known by fetching data from the server in a background thread. This does not use caching. This is preferable to using the AVObject(className, objectId) constructor, unless your code is already running in a background thread.

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,
  • getFirstInBackground,
  • getInclude,
  • getLimit

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for Android Studio
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