I'm new to Java, but know Objective-C. I need to access fields < keys, values > in a downloaded Object.
Below is the code:
car
is an Schema
and car_id
is the field to query
Map<String, List<SMObject>> feedback = new HashMap<String, List<SMObject>>();
List<SMCondition> query = new ArrayList<SMCondition>();
DataService ds = serviceProvider.getDataService();
List<SMObject> results;
try {
query.add(new SMEquals("car_id", new SMString(make)));
results = ds.readObjects("car", query);
if (results != null && results.size() > 0) {
feedback.put(make, results);
}
}
....
results is an Object downloaded from a remote Database that is basically a HashMap. Assuming there is only one object that is returned each time, what would be the code to access Key & Values in the returned results object?
Complete Code in case you want to see it.
EDIT
Can I do something like this:
SMObject resultObj;
if (results != null && results.size() > 0) {
resultObj = results[0];
resultObj.put("resolved", "1");
resultObj.put("accepted", "1");
resultObj.put("declined", "0");
String model = (String)resultObj.get("model");
}