本文整理匯總了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;
}
示例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.
}
}
}
示例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;
}
示例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];
}