@@ -144,22 +144,27 @@ public MultiDocumentEntity<DocumentCreateEntity<T>> deserialize(final Response r
144144 final MultiDocumentEntity <DocumentCreateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentCreateEntity <T >>();
145145 final Collection <DocumentCreateEntity <T >> docs = new ArrayList <DocumentCreateEntity <T >>();
146146 final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
147+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
147148 final VPackSlice body = response .getBody ();
148149 for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
149150 final VPackSlice next = iterator .next ();
150151 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 );
152155 } else {
153156 final DocumentCreateEntity <T > doc = util ().deserialize (next , DocumentCreateEntity .class );
154157 final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
155158 if (newDoc .isObject ()) {
156159 doc .setNew ((T ) util ().deserialize (newDoc , type ));
157160 }
158161 docs .add (doc );
162+ documentsAndErrors .add (doc );
159163 }
160164 }
161165 multiDocument .setDocuments (docs );
162166 multiDocument .setErrors (errors );
167+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
163168 return multiDocument ;
164169 }
165170 };
@@ -214,17 +219,23 @@ public MultiDocumentEntity<T> deserialize(final Response response) throws VPackE
214219 final MultiDocumentEntity <T > multiDocument = new MultiDocumentEntity <T >();
215220 final Collection <T > docs = new ArrayList <T >();
216221 final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
222+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
217223 final VPackSlice body = response .getBody ();
218224 for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
219225 final VPackSlice next = iterator .next ();
220226 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 );
222230 } 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 );
224234 }
225235 }
226236 multiDocument .setDocuments (docs );
227237 multiDocument .setErrors (errors );
238+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
228239 return multiDocument ;
229240 }
230241 };
@@ -301,11 +312,14 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
301312 final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentUpdateEntity <T >>();
302313 final Collection <DocumentUpdateEntity <T >> docs = new ArrayList <DocumentUpdateEntity <T >>();
303314 final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
315+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
304316 final VPackSlice body = response .getBody ();
305317 for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
306318 final VPackSlice next = iterator .next ();
307319 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 );
309323 } else {
310324 final DocumentUpdateEntity <T > doc = util ().deserialize (next , DocumentUpdateEntity .class );
311325 final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
@@ -317,10 +331,12 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
317331 doc .setOld ((T ) util ().deserialize (oldDoc , type ));
318332 }
319333 docs .add (doc );
334+ documentsAndErrors .add (doc );
320335 }
321336 }
322337 multiDocument .setDocuments (docs );
323338 multiDocument .setErrors (errors );
339+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
324340 return multiDocument ;
325341 }
326342 };
@@ -398,11 +414,14 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
398414 final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <DocumentUpdateEntity <T >>();
399415 final Collection <DocumentUpdateEntity <T >> docs = new ArrayList <DocumentUpdateEntity <T >>();
400416 final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
417+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
401418 final VPackSlice body = response .getBody ();
402419 for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
403420 final VPackSlice next = iterator .next ();
404421 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 );
406425 } else {
407426 final DocumentUpdateEntity <T > doc = util ().deserialize (next , DocumentUpdateEntity .class );
408427 final VPackSlice newDoc = next .get (ArangoDBConstants .NEW );
@@ -414,10 +433,12 @@ public MultiDocumentEntity<DocumentUpdateEntity<T>> deserialize(final Response r
414433 doc .setOld ((T ) util ().deserialize (oldDoc , type ));
415434 }
416435 docs .add (doc );
436+ documentsAndErrors .add (doc );
417437 }
418438 }
419439 multiDocument .setDocuments (docs );
420440 multiDocument .setErrors (errors );
441+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
421442 return multiDocument ;
422443 }
423444 };
@@ -472,22 +493,27 @@ public MultiDocumentEntity<DocumentDeleteEntity<T>> deserialize(final Response r
472493 final MultiDocumentEntity <DocumentDeleteEntity <T >> multiDocument = new MultiDocumentEntity <DocumentDeleteEntity <T >>();
473494 final Collection <DocumentDeleteEntity <T >> docs = new ArrayList <DocumentDeleteEntity <T >>();
474495 final Collection <ErrorEntity > errors = new ArrayList <ErrorEntity >();
496+ final Collection <Object > documentsAndErrors = new ArrayList <Object >();
475497 final VPackSlice body = response .getBody ();
476498 for (final Iterator <VPackSlice > iterator = body .arrayIterator (); iterator .hasNext ();) {
477499 final VPackSlice next = iterator .next ();
478500 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 );
480504 } else {
481505 final DocumentDeleteEntity <T > doc = util ().deserialize (next , DocumentDeleteEntity .class );
482506 final VPackSlice oldDoc = next .get (ArangoDBConstants .OLD );
483507 if (oldDoc .isObject ()) {
484508 doc .setOld ((T ) util ().deserialize (oldDoc , type ));
485509 }
486510 docs .add (doc );
511+ documentsAndErrors .add (doc );
487512 }
488513 }
489514 multiDocument .setDocuments (docs );
490515 multiDocument .setErrors (errors );
516+ multiDocument .setDocumentsAndErrors (documentsAndErrors );
491517 return multiDocument ;
492518 }
493519 };
0 commit comments