Revision 50331
Added by Panagiotis Kanakakis over 6 years ago
Converter.java | ||
---|---|---|
304 | 304 |
|
305 | 305 |
public static List<AggregationDetails> getAggregationHistoryFromJson(JSONObject repositoryObject) throws JSONException { |
306 | 306 |
|
307 |
if( repositoryObject.get("aggregationHistory").toString().equals("[]") || |
|
307 |
/* if( repositoryObject.get("aggregationHistory").toString().equals("[]") ||
|
|
308 | 308 |
repositoryObject.get("aggregationHistory")!= null) |
309 |
return null; |
|
309 |
return null;*/ |
|
310 |
if(repositoryObject.get("aggregationHistory").toString().equals("null")) |
|
311 |
return null; |
|
310 | 312 |
|
311 | 313 |
|
312 | 314 |
JSONArray rs = new JSONArray(repositoryObject.get("aggregationHistory").toString()); |
315 |
|
|
313 | 316 |
List<AggregationDetails> aggregationDetailsList = new ArrayList<>(); |
314 | 317 |
for(int i=0;i<rs.length();i++) |
315 | 318 |
aggregationDetailsList.add(jsonToAggregationDetails(rs.getJSONObject(i))); |
... | ... | |
319 | 322 |
private static AggregationDetails jsonToAggregationDetails(JSONObject aggregationObject) throws JSONException { |
320 | 323 |
|
321 | 324 |
AggregationDetails aggregationDetails = new AggregationDetails(); |
325 |
|
|
322 | 326 |
aggregationDetails.setAggregationStage(aggregationObject.get("aggregationStage").toString()); |
323 | 327 |
//aggregationDetails.setCollectionMode(aggregationObject.get("collectionMode").toString()); |
324 | 328 |
aggregationDetails.setDate(convertStringToDate(aggregationObject.get("date").toString())); |
Also available in: Unified diff
Bug fix on converter class for aggregation method