当前位置: 首页>>代码示例>>Java>>正文


Java ParseObject.get方法代码示例

本文整理汇总了Java中com.parse.ParseObject.get方法的典型用法代码示例。如果您正苦于以下问题:Java ParseObject.get方法的具体用法?Java ParseObject.get怎么用?Java ParseObject.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.parse.ParseObject的用法示例。


在下文中一共展示了ParseObject.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConnections

import com.parse.ParseObject; //导入方法依赖的package包/类
public ArrayList<String> getConnections(String username) {
    List<ParseObject> ob = null;
    ArrayList<String> connectionList = new ArrayList<String>();
    ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Connection");
    query.whereEqualTo("username", username);
    try {
        ob = query.find();
    } catch (ParseException e) {
        Log.e("Error", e.getMessage());
        e.printStackTrace();
    }
    for (ParseObject connection : ob) {
        connectionList = (ArrayList<String>) connection.get("connections");
    }
    return connectionList;
}
 
开发者ID:cfudge,项目名称:ClassDiscuss,代码行数:17,代码来源:OtherUsers.java

示例2: ParseProxyObject

import com.parse.ParseObject; //导入方法依赖的package包/类
public ParseProxyObject(ParseObject object) {
	
	// Loop the keys in the ParseObject
	for(String key : object.keySet()) {
		@SuppressWarnings("rawtypes")
		Class classType = object.get(key).getClass();
		if(classType == byte[].class || classType == String.class || 
				classType == Integer.class || classType == Boolean.class) {
			values.put(key, object.get(key));
		} else if(classType == ParseUser.class) {
			ParseProxyObject parseUserObject = new ParseProxyObject((ParseObject)object.get(key));
			values.put(key, parseUserObject);
		} else {
			// You might want to add more conditions here, for embedded ParseObject, ParseFile, etc.
		}
	}
}
 
开发者ID:dougritter,项目名称:mirante,代码行数:18,代码来源:ParseProxyObject.java

示例3: ObjectToHashMap

import com.parse.ParseObject; //导入方法依赖的package包/类
public static HashMap ObjectToHashMap(ParseObject parseObject) {
  HashMap map = new HashMap();

  if (parseObject != null) {
    Set<String> keySet = parseObject.keySet();

    for (String key : keySet) {
      Object value = parseObject.get(key);

      if (value instanceof Boolean || value instanceof String || value instanceof Integer ||
          value instanceof Float || value instanceof Double ||
          value instanceof HashMap || value instanceof Date)
      {
        map.put(key, value);
      }
      else if (value instanceof ArrayList) {
        map.put(key, ParseDataConversions.ArrayListToHashMapArray((ArrayList)value));
      }
      else if (value instanceof ParseObject) {
        HashMap convertedObject = ParseDataConversions.ObjectToHashMap((ParseObject)value);
        map.put(key, convertedObject);
      }
      else if (value instanceof ParseGeoPoint) {
        map.put(key, ParseDataConversions.GeoPointToHashMap((ParseGeoPoint)value));
      }
      else if (value instanceof ParseRelation) {
        map.put(key, ParseDataConversions.RelationToHashMap((ParseRelation)value));
      }
      else if (value instanceof ParseFile) {
        map.put(key, ParseDataConversions.FileToHashMap((ParseFile)value));
        Log.e(TAG, "Returned data contains an unsupported column type: ParseFile");
      }
      else {
        Log.e(TAG, "Unrecognized object in ArrayList, skipping:" + key + " " + value.getClass().getName());
      }
    }

    // Remember class name, object IDs, created and updated dates
    map.put("_className", parseObject.getClassName());
    map.put("_objectId", parseObject.getObjectId());
    map.put("_createdAt", parseObject.getCreatedAt());
    map.put("_updatedAt", parseObject.getUpdatedAt());
  }

  return map;
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:47,代码来源:ParseDataConversions.java

示例4: doInBackground

import com.parse.ParseObject; //导入方法依赖的package包/类
@Override
protected String doInBackground(String... params) {

	ParseQuery<ParseObject> query = ParseQuery.getQuery("Backup");
	query.whereEqualTo("uidUser", getEmail(activity));


	try {
		List<ParseObject> backups = query.find();


		if (backups.size() > 0) {
			ParseObject backup = backups.get(0);

			String historyXml = (String) backup.get("history");
			String moodXml = (String) backup.get("moods");
			String absencesXml = (String) backup.get("absences");


			XStream xStream = new XStream();
			List<Historico> historicos = (List<Historico>) xStream.fromXML(historyXml);


			for (Historico historico : historicos) {
				if (HistoricoDAO.getInstance(activity).recuperarPorId(historico.getId()) == null) {
					HistoricoDAO.getInstance(activity).salvar(historico);
				}
			}

			List<Mood> moods = (List<Mood>) xStream.fromXML(moodXml);

			for (Mood mood : moods) {
				if (MoodDAO.getInstance(activity).recuperarPorId(mood.getId()) == null) {
					MoodDAO.getInstance(activity).salvar(mood);
				}
			}


			List<Falta> faltas = (List<Falta>) xStream.fromXML(absencesXml);

			for (Falta falta : faltas) {
				if (FaltaDAO.getInstance(activity).recuperarPorId(falta.getId()) == null) {
					FaltaDAO.getInstance(activity).salvar(falta);
				}
			}

		} else {

		}
	} catch (ParseException e) {
		e.printStackTrace();
	}

	return params[0];
}
 
开发者ID:flaviojmendes,项目名称:hefesto,代码行数:56,代码来源:ImportarBackupTask.java


注:本文中的com.parse.ParseObject.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。