@Override public void onSuccess(String content, AVException e) { try { Date date = AVUtils.dateFromMap(JSON.parseObject(content, Map.class)); if (callback != null) { callback.internalDone(date, null); } } catch (Exception ex) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(ex, null)); } } }
@Override public void onSuccess(String content, AVException e) { try { Date date = AVUtils.dateFromMap(JSON.parseObject(content, Map.class)); if (callback != null) { callback.internalDone(date, null); } } catch (Exception ex) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(ex, null)); } } }
static Object getObjectFrom(Map<String, Object> map) { Object type = map.get("__type"); if (type == null || !(type instanceof String)) { Map<String, Object> newMap = new HashMap<String, Object>(map.size()); for (Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey(); Object o = entry.getValue(); newMap.put(key, getObjectFrom(o)); } return newMap; } else if (type.equals("Pointer") || type.equals("Object")) { AVObject avObject = objectFromClassName((String) map.get("className")); map.remove("__type"); AVUtils.copyPropertiesFromMapToAVObject(map, avObject); return avObject; } else if (type.equals("GeoPoint")) { return AVUtils.geoPointFromMap(map); } else if (type.equals("Bytes")) { return AVUtils.dataFromMap(map); } else if (type.equals("Date")) { return AVUtils.dateFromMap(map); } else if (type.equals("Relation")) { return AVUtils.objectFromRelationMap(map); } else if (type.equals("File")) { return AVUtils.fileFromMap(map); } return map; }
static Object getObjectFrom(Map<String, Object> map) { Object type = map.get("__type"); if (type == null || !(type instanceof String)) { Map<String, Object> newMap = new HashMap<String, Object>(map.size()); for (Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey(); Object o = entry.getValue(); newMap.put(key, getObjectFrom(o)); } return newMap; } else if (type.equals("Pointer") || type.equals("Object")) { AVObject parseObject = objectFromClassName((String) map.get("className")); map.remove("__type"); AVUtils.copyPropertiesFromMapToAVObject(map, parseObject); return parseObject; } else if (type.equals("GeoPoint")) { return AVUtils.geoPointFromMap(map); } else if (type.equals("Bytes")) { return AVUtils.dataFromMap(map); } else if (type.equals("Date")) { return AVUtils.dateFromMap(map); } else if (type.equals("Relation")) { return AVUtils.objectFromRelationMap(map); } else if (type.equals("File")) { return AVFile.fileFromMap(map); } return map; }
conversation.setLastMessageAt(AVUtils.dateFromMap(jsonObj.getObject(Conversation.LAST_MESSAGE_AT, Map.class)));
parent.put(key, point, false); } else if (isDate(type)) { Date date = dateFromMap(map); parent.put(key, date, false); } else if (isData(type)) {
parent.put(key, point, false); } else if (isDate(type)) { Date date = dateFromMap(map); parent.put(key, date, false); } else if (isData(type)) {