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

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

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

origin: cn.leancloud/leancloud-common

public static <T extends AVObject> AVQuery<T> and(List<AVQuery<T>> queries) {
 String className = null;
 if (queries.size() > 0) {
  className = queries.get(0).getClassName();
 }
 AVQuery<T> result = new AVQuery<T>(className);
 if (queries.size() > 1) {
  for (AVQuery<T> query : queries) {
   if (!className.equals(query.getClassName())) {
    throw new IllegalArgumentException("All queries must be for the same class");
   }
   result.addAndItems(query);
  }
 } else {
  result.setWhere(queries.get(0).conditions.getWhere());
 }
 return result;
}
origin: cn.leancloud.android/avoscloud-sdk

public static <T extends AVObject> AVQuery<T> and(List<AVQuery<T>> queries) {
 String className = null;
 if (queries.size() > 0) {
  className = queries.get(0).getClassName();
 }
 AVQuery<T> result = new AVQuery<T>(className);
 if (queries.size() > 1) {
  for (AVQuery<T> query : queries) {
   if (!className.equals(query.getClassName())) {
    throw new IllegalArgumentException("All queries must be for the same class");
   }
   result.addAndItems(query);
  }
 } else {
  result.setWhere(queries.get(0).conditions.getWhere());
 }
 return result;
}
origin: cn.leancloud.android/avoscloud-sdk

private String queryPath() {
 if (!AVUtils.isBlankString(externalQueryPath)) {
  return externalQueryPath;
 }
 return AVPowerfulUtils.getEndpoint(getClassName());
}
origin: cn.leancloud/leancloud-common

private String queryPath() {
 if (!AVUtils.isBlankString(externalQueryPath)) {
  return externalQueryPath;
 }
 return AVPowerfulUtils.getEndpoint(getClassName());
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * Constructs a query that is the or of the given queries.
 *
 * @param queries The list of AVQueries to 'or' together
 * @return A AVQuery that is the 'or' of the passed in queries
 */
public static <T extends AVObject> AVQuery<T> or(List<AVQuery<T>> queries) {
 String className = null;
 if (queries.size() > 0) {
  className = queries.get(0).getClassName();
 }
 AVQuery<T> result = new AVQuery<T>(className);
 if (queries.size() > 1) {
  for (AVQuery<T> query : queries) {
   if (!className.equals(query.getClassName())) {
    throw new IllegalArgumentException("All queries must be for the same class");
   }
   result.addOrItems(new QueryOperation("$or", "$or", query.conditions
     .compileWhereOperationMap()));
  }
 } else {
  result.setWhere(queries.get(0).conditions.getWhere());
 }
 return result;
}
origin: cn.leancloud/leancloud-common

/**
 * Constructs a query that is the or of the given queries.
 *
 * @param queries The list of AVQueries to 'or' together
 * @return A AVQuery that is the 'or' of the passed in queries
 */
public static <T extends AVObject> AVQuery<T> or(List<AVQuery<T>> queries) {
 String className = null;
 if (queries.size() > 0) {
  className = queries.get(0).getClassName();
 }
 AVQuery<T> result = new AVQuery<T>(className);
 if (queries.size() > 1) {
  for (AVQuery<T> query : queries) {
   if (!className.equals(query.getClassName())) {
    throw new IllegalArgumentException("All queries must be for the same class");
   }
   result.addOrItems(new QueryOperation("$or", "$or", query.conditions
     .compileWhereOperationMap()));
  }
 } else {
  result.setWhere(queries.get(0).conditions.getWhere());
 }
 return result;
}
origin: cn.leancloud/leancloud-common

@SuppressWarnings("unchecked")
protected List<T> processResults(String content) throws Exception {
 if (AVUtils.isBlankContent(content)) {
  return Collections.emptyList();
 }
 AVResponse resp = new AVResponse();
 resp = JSON.parseObject(content, resp.getClass());
 List<T> result = new LinkedList<T>();
 for (Map item : resp.results) {
  if (item != null && !item.isEmpty()) {
   AVObject object;
   if (clazz != null) {
    object = clazz.newInstance();
   } else {
    object = AVUtils.newAVObjectByClassName(resp.className, this.getClassName());
   }
   AVUtils.copyPropertiesFromMapToAVObject(item, object);
   object.rebuildInstanceData();
   result.add((T) object);
  }
 }
 return result;
}
origin: cn.leancloud.android/avoscloud-sdk

@SuppressWarnings("unchecked")
protected List<T> processResults(String content) throws Exception {
 if (AVUtils.isBlankContent(content)) {
  return Collections.emptyList();
 }
 AVResponse resp = new AVResponse();
 resp = JSON.parseObject(content, resp.getClass());
 List<T> result = new LinkedList<T>();
 for (Map item : resp.results) {
  if (item != null && !item.isEmpty()) {
   AVObject object;
   if (clazz != null) {
    object = clazz.newInstance();
   } else {
    object = AVUtils.newAVObjectByClassName(resp.className, this.getClassName());
   }
   AVUtils.copyPropertiesFromMapToAVObject(item, object);
   object.rebuildInstanceData();
   result.add((T) object);
  }
 }
 return result;
}
origin: cn.leancloud/leancloud-common

/**
 * Add a constraint to the query that requires a particular key's value matches a value for a key
 * in the results of another AVQuery
 *
 * @param key The key whose value is being checked
 * @param keyInQuery The key in the objects from the sub query to look in
 * @param query The sub query to run
 * @return Returns the query so you can chain this call.
 */
public AVQuery<T> whereMatchesKeyInQuery(String key, String keyInQuery, AVQuery<?> query) {
 Map<String, Object> inner = new HashMap<String, Object>();
 inner.put("className", query.getClassName());
 inner.put("where", query.conditions.compileWhereOperationMap());
 if (query.conditions.getSkip() > 0)
  inner.put("skip", query.conditions.getSkip());
 if (query.conditions.getLimit() > 0)
  inner.put("limit", query.conditions.getLimit());
 if (!AVUtils.isBlankContent(query.getOrder()))
  inner.put("order", query.getOrder());
 Map<String, Object> queryMap = new HashMap<String, Object>();
 queryMap.put("query", inner);
 queryMap.put("key", keyInQuery);
 return addWhereItem(key, "$select", queryMap);
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * Add a constraint to the query that requires a particular key's value matches a value for a key
 * in the results of another AVQuery
 *
 * @param key The key whose value is being checked
 * @param keyInQuery The key in the objects from the sub query to look in
 * @param query The sub query to run
 * @return Returns the query so you can chain this call.
 */
public AVQuery<T> whereMatchesKeyInQuery(String key, String keyInQuery, AVQuery<?> query) {
 Map<String, Object> inner = new HashMap<String, Object>();
 inner.put("className", query.getClassName());
 inner.put("where", query.conditions.compileWhereOperationMap());
 if (query.conditions.getSkip() > 0) inner.put("skip", query.conditions.getSkip());
 if (query.conditions.getLimit() > 0) inner.put("limit", query.conditions.getLimit());
 if (!AVUtils.isBlankContent(query.getOrder())) inner.put("order", query.getOrder());
 Map<String, Object> queryMap = new HashMap<String, Object>();
 queryMap.put("query", inner);
 queryMap.put("key", keyInQuery);
 return addWhereItem(key, "$select", queryMap);
}
origin: cn.leancloud/leancloud-common

private void sendInBackground(boolean sync, final SaveCallback callback) {
 if (!checkCurrentUser(callback)) {
  return;
 }
 if (query == null) {
  AVStatus.sendStatusToFollowersInBackgroud(sync, this, callback);
  return;
 }
 Map<String, Object> queryBody = new HashMap<String, Object>();
 Map<String, Object> parameters = myQueryParameters(query);
 queryBody.putAll(parameters);
 queryBody.put("className", query.getClassName());
 // 之前好像直接设成Timeline,而inboxType会永远被忽略掉。
 Map<String, Object> body =
   statusBody(this, AVUtils.isBlankString(this.inboxType) ? INBOX_TYPE.TIMELINE.toString()
     : this.inboxType, queryBody);
 postStatusImpl(this, body, callback, sync);
}
origin: cn.leancloud.android/avoscloud-sdk

public void sendInBackground(final SaveCallback callback) {
 if (!checkCurrentUser(callback)) {
  return;
 }
 if (query == null) {
  AVStatus.sendStatusToFollowersInBackgroud(this, callback);
  return;
 }
 Map<String, Object> queryBody = new HashMap<String, Object>();
 Map<String, Object> parameters = myQueryParameters(query);
 queryBody.putAll(parameters);
 queryBody.put("className", query.getClassName());
 // 之前好像直接设成Timeline,而inboxType会永远被忽略掉。
 Map<String, Object> body =
   statusBody(this, AVUtils.isBlankString(this.inboxType)
     ? INBOX_TYPE.TIMELINE.toString()
     : this.inboxType, queryBody);
 postStatusImpl(this, body, callback);
}
origin: cn.leancloud/java-sdk

/**
 * A helper method to concisely send a push to a query. This method is equivalent to
 * 
 * <pre>
 * AVPush push = new AVPush();
 * push.setData(data);
 * push.setQuery(query);
 * push.sendInBackground();
 * </pre>
 * 
 * @param data The entire data of the push message. See the push guide for more details on the
 *        data format.
 * @param query A AVInstallation query which specifies the recipients of a push.
 * @throws AVException if query is not valid
 */
static void sendDataInBackground(JSONObject data, AVQuery<? extends AVObject> query)
  throws AVException {
 if (!query.getClassName().equals(INSTALLATIONTAG)) {
  throw new AVException(AVException.OTHER_CAUSE, "only installation query is valid");
 }
 AVPush push = new AVPush();
 push.setData(data);
 push.setQuery(query);
 push.sendInBackground();
}
origin: cn.leancloud.android/avoscloud-push

params.put("className", query.getClassName());
origin: cn.leancloud/java-sdk

/**
 * A helper method to concisely send a push message to a query. This method is equivalent to
 * 
 * <pre>
 * AVPush push = new AVPush();
 * push.setMessage(message);
 * push.setQuery(query);
 * push.sendInBackground();
 * </pre>
 * 
 * @param message The message that will be shown in the notification.
 * @param query A AVInstallation query which specifies the recipients of a push.
 */
public static void sendMessageInBackground(String message, AVQuery<? extends AVObject> query) {
 if (!query.getClassName().equals(INSTALLATIONTAG)) {
  InternalConfigurationController.globalInstance().getInternalLogger()
    .e(AVPush.class.getSimpleName(), "only installation query is valid");
  return;
 }
 AVPush push = new AVPush();
 push.setMessage(message);
 push.setQuery(query);
 push.sendInBackground(false, null);
}
origin: cn.leancloud/java-sdk

/**
 * A helper method to concisely send a push message to a query. This method is equivalent to
 * 
 * <pre>
 * AVPush push = new AVPush();
 * push.setMessage(message);
 * push.setQuery(query);
 * push.sendInBackground(callback);
 * </pre>
 * 
 * @param message The message that will be shown in the notification.
 * @param query A AVInstallation query which specifies the recipients of a push.
 * @param callback callback.done(e) is called when the send completes.
 */
public static void sendMessageInBackground(String message, AVQuery<? extends AVObject> query,
  SendCallback callback) {
 if (!query.getClassName().equals(INSTALLATIONTAG)) {
  if (callback != null) {
   callback.done(new AVException(AVException.OTHER_CAUSE, "only installation query is valid"));
  }
 }
 AVPush push = new AVPush();
 push.setMessage(message);
 push.setQuery(query);
 push.sendInBackground(false, callback);
}
origin: cn.leancloud/java-sdk

/**
 * A helper method to concisely send a push to a query. This method is equivalent to
 * 
 * <pre>
 * AVPush push = new AVPush();
 * push.setData(data);
 * push.setQuery(query);
 * push.sendInBackground(callback);
 * </pre>
 * 
 * @param data The entire data of the push message. See the push guide for more details on the
 *        data format.
 * @param query A AVInstallation query which specifies the recipients of a push.
 * @param callback callback.done(e) is called when the send completes.
 */
public static void sendDataInBackground(JSONObject data, AVQuery<? extends AVObject> query,
  SendCallback callback) {
 if (!query.getClassName().equals(INSTALLATIONTAG)) {
  if (callback != null) {
   callback.done(new AVException(AVException.OTHER_CAUSE, "only installation query is valid"));
  }
 }
 AVPush push = new AVPush();
 push.setData(data);
 push.setQuery(query);
 push.sendInBackground(false, callback);
}
origin: cn.leancloud.android/avoscloud-sdk

Map<String, String> params = null;
if (option != null && option.matchQuery != null) {
 if (this.getClassName() != null && !this.getClassName().equals(option.matchQuery.getClassName())) {
  callback.internalDone(new AVException(0, "AVObject class inconsistant with AVQuery in AVDeleteOption"));
  return;
origin: cn.leancloud/leancloud-common

object = (T) AVUtils.newAVObjectByClassName(AVQuery.this.getClassName());
origin: cn.leancloud.android/avoscloud-sdk

(T) AVUtils.newAVObjectByClassName(AVQuery.this.getClassName());
com.avos.avoscloudAVQuerygetClassName

Javadoc

Accessor for the class name.

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
  • 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
  • addWhereItem
  • addOrItems,
  • addWhereItem,
  • doCloudQuery,
  • generateQueryPath,
  • get,
  • getFirstInBackground,
  • getInBackground,
  • getInclude,
  • getLimit

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Top Sublime Text plugins
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