@@ -144,22 +144,27 @@ public MultiDocumentEntity<DocumentCreateEntity<T>> deserialize(final Response r
144
144
final MultiDocumentEntity <DocumentCreateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentCreateEntity <T >>();
145
145
final Collection <DocumentCreateEntity <T >> docs = new ArrayList <DocumentCreateEntity <T >>();
146
146
final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
147
+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
147
148
final VPackSlice body = response .getBody ();
148
149
for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
149
150
final VPackSlice next = iterator .next ();
150
151
if (next .get (ArangoDBConstants .ERROR ).isTrue ()) {
151
- errors .add ((ErrorEntity ) util ().deserialize (next , ErrorEntity .class ));
152
+ final ErrorEntity error = (ErrorEntity ) util ().deserialize (next , ErrorEntity .class );
153
+ errors .add (error );
154
+ documentsAndErrors .add (error );
152
155
} else {
153
156
final DocumentCreateEntity <T > doc = util ().deserialize (next , DocumentCreateEntity .class );
154
157
final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
155
158
if (newDoc .isObject ()) {
156
159
doc .setNew ((T ) util ().deserialize (newDoc , type ));
157
160
}
158
161
docs .add (doc );
162
+ documentsAndErrors .add (doc );
159
163
}
160
164
}
161
165
multiDocument .setDocuments (docs );
162
166
multiDocument .setErrors (errors );
167
+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
163
168
return multiDocument ;
164
169
}
165
170
};
@@ -214,17 +219,23 @@ public MultiDocumentEntity<T> deserialize(final Response response) throws VPackE
214
219
final MultiDocumentEntity <T > multiDocument = new MultiDocumentEntity <T >();
215
220
final Collection <T > docs = new ArrayList <T >();
216
221
final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
222
+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
217
223
final VPackSlice body = response .getBody ();
218
224
for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
219
225
final VPackSlice next = iterator .next ();
220
226
if (next .get (ArangoDBConstants .ERROR ).isTrue ()) {
221
- errors .add ((ErrorEntity ) util ().deserialize (next , ErrorEntity .class ));
227
+ final ErrorEntity error = (ErrorEntity ) util ().deserialize (next , ErrorEntity .class );
228
+ errors .add (error );
229
+ documentsAndErrors .add (error );
222
230
} else {
223
- docs .add ((T ) util ().deserialize (next , type ));
231
+ final T doc = (T ) util ().deserialize (next , type );
232
+ docs .add (doc );
233
+ documentsAndErrors .add (doc );
224
234
}
225
235
}
226
236
multiDocument .setDocuments (docs );
227
237
multiDocument .setErrors (errors );
238
+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
228
239
return multiDocument ;
229
240
}
230
241
};
@@ -301,11 +312,14 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
301
312
final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentUpdateEntity <T >>();
302
313
final Collection <DocumentUpdateEntity <T >> docs = new ArrayList <DocumentUpdateEntity <T >>();
303
314
final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
315
+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
304
316
final VPackSlice body = response .getBody ();
305
317
for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
306
318
final VPackSlice next = iterator .next ();
307
319
if (next .get (ArangoDBConstants .ERROR ).isTrue ()) {
308
- errors .add ((ErrorEntity ) util ().deserialize (next , ErrorEntity .class ));
320
+ final ErrorEntity error = (ErrorEntity ) util ().deserialize (next , ErrorEntity .class );
321
+ errors .add (error );
322
+ documentsAndErrors .add (error );
309
323
} else {
310
324
final DocumentUpdateEntity <T > doc = util ().deserialize (next , DocumentUpdateEntity .class );
311
325
final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
@@ -317,10 +331,12 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
317
331
doc .setOld ((T ) util ().deserialize (oldDoc , type ));
318
332
}
319
333
docs .add (doc );
334
+ documentsAndErrors .add (doc );
320
335
}
321
336
}
322
337
multiDocument .setDocuments (docs );
323
338
multiDocument .setErrors (errors );
339
+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
324
340
return multiDocument ;
325
341
}
326
342
};
@@ -398,11 +414,14 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
398
414
final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentUpdateEntity <T >>();
399
415
final Collection <DocumentUpdateEntity <T >> docs = new ArrayList <DocumentUpdateEntity <T >>();
400
416
final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
417
+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
401
418
final VPackSlice body = response .getBody ();
402
419
for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
403
420
final VPackSlice next = iterator .next ();
404
421
if (next .get (ArangoDBConstants .ERROR ).isTrue ()) {
405
- errors .add ((ErrorEntity ) util ().deserialize (next , ErrorEntity .class ));
422
+ final ErrorEntity error = (ErrorEntity ) util ().deserialize (next , ErrorEntity .class );
423
+ errors .add (error );
424
+ documentsAndErrors .add (error );
406
425
} else {
407
426
final DocumentUpdateEntity <T > doc = util ().deserialize (next , DocumentUpdateEntity .class );
408
427
final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
@@ -414,10 +433,12 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
414
433
doc .setOld ((T ) util ().deserialize (oldDoc , type ));
415
434
}
416
435
docs .add (doc );
436
+ documentsAndErrors .add (doc );
417
437
}
418
438
}
419
439
multiDocument .setDocuments (docs );
420
440
multiDocument .setErrors (errors );
441
+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
421
442
return multiDocument ;
422
443
}
423
444
};
@@ -472,22 +493,27 @@ public MultiDocumentEntity<DocumentDeleteEntity<T>> deserialize(final Response r
472
493
final MultiDocumentEntity <DocumentDeleteEntity <T >> multiDocument = new MultiDocumentEntity <DocumentDeleteEntity <T >>();
473
494
final Collection <DocumentDeleteEntity <T >> docs = new ArrayList <DocumentDeleteEntity <T >>();
474
495
final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
496
+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
475
497
final VPackSlice body = response .getBody ();
476
498
for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
477
499
final VPackSlice next = iterator .next ();
478
500
if (next .get (ArangoDBConstants .ERROR ).isTrue ()) {
479
- errors .add ((ErrorEntity ) util ().deserialize (next , ErrorEntity .class ));
501
+ final ErrorEntity error = (ErrorEntity ) util ().deserialize (next , ErrorEntity .class );
502
+ errors .add (error );
503
+ documentsAndErrors .add (error );
480
504
} else {
481
505
final DocumentDeleteEntity <T > doc = util ().deserialize (next , DocumentDeleteEntity .class );
482
506
final VPackSlice oldDoc = next .get (ArangoDBConstants .OLD );
483
507
if (oldDoc .isObject ()) {
484
508
doc .setOld ((T ) util ().deserialize (oldDoc , type ));
485
509
}
486
510
docs .add (doc );
511
+ documentsAndErrors .add (doc );
487
512
}
488
513
}
489
514
multiDocument .setDocuments (docs );
490
515
multiDocument .setErrors (errors );
516
+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
491
517
return multiDocument ;
492
518
}
493
519
};
0 commit comments