@@ -110,7 +110,7 @@ private InternalRequest createInsertDocumentRequest(final DocumentCreateOptions
110
110
}
111
111
112
112
protected <T > ResponseDeserializer <MultiDocumentEntity <DocumentCreateEntity <T >>> insertDocumentsResponseDeserializer (Class <T > userDataClass ) {
113
- return response -> {
113
+ return ( response , ctx ) -> {
114
114
final MultiDocumentEntity <DocumentCreateEntity <T >> multiDocument = new MultiDocumentEntity <>();
115
115
final List <DocumentCreateEntity <T >> docs = new ArrayList <>();
116
116
final List <ErrorEntity > errors = new ArrayList <>();
@@ -119,12 +119,12 @@ protected <T> ResponseDeserializer<MultiDocumentEntity<DocumentCreateEntity<T>>>
119
119
for (final JsonNode next : body ) {
120
120
JsonNode isError = next .get (ArangoResponseField .ERROR_FIELD_NAME );
121
121
if (isError != null && isError .booleanValue ()) {
122
- final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class );
122
+ final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class , ctx );
123
123
errors .add (error );
124
124
documentsAndErrors .add (error );
125
125
} else {
126
126
Type type = constructParametricType (DocumentCreateEntity .class , userDataClass );
127
- final DocumentCreateEntity <T > doc = getSerde ().deserialize (next , type );
127
+ final DocumentCreateEntity <T > doc = getSerde ().deserialize (next , type , ctx );
128
128
docs .add (doc );
129
129
documentsAndErrors .add (doc );
130
130
}
@@ -168,7 +168,7 @@ protected InternalRequest getDocumentRequest(final String key, final DocumentRea
168
168
}
169
169
170
170
protected <T > ResponseDeserializer <T > getDocumentResponseDeserializer (final Class <T > type ) {
171
- return response -> getSerde ().deserializeUserData (response .getBody (), type );
171
+ return ( response , ctx ) -> getSerde ().deserializeUserData (response .getBody (), type , ctx );
172
172
}
173
173
174
174
protected InternalRequest getDocumentsRequest (final Iterable <String > keys , final DocumentReadOptions options ) {
@@ -186,7 +186,7 @@ protected InternalRequest getDocumentsRequest(final Iterable<String> keys, final
186
186
187
187
protected <T > ResponseDeserializer <MultiDocumentEntity <T >> getDocumentsResponseDeserializer (
188
188
final Class <T > type ) {
189
- return response -> {
189
+ return ( response , ctx ) -> {
190
190
final MultiDocumentEntity <T > multiDocument = new MultiDocumentEntity <>();
191
191
boolean potentialDirtyRead = Boolean .parseBoolean (response .getMeta ("X-Arango-Potential-Dirty-Read" ));
192
192
multiDocument .setPotentialDirtyRead (potentialDirtyRead );
@@ -197,11 +197,11 @@ protected <T> ResponseDeserializer<MultiDocumentEntity<T>> getDocumentsResponseD
197
197
for (final JsonNode next : body ) {
198
198
JsonNode isError = next .get (ArangoResponseField .ERROR_FIELD_NAME );
199
199
if (isError != null && isError .booleanValue ()) {
200
- final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class );
200
+ final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class , ctx );
201
201
errors .add (error );
202
202
documentsAndErrors .add (error );
203
203
} else {
204
- final T doc = getSerde ().deserializeUserData (getSerde ().serialize (next ), type );
204
+ final T doc = getSerde ().deserializeUserData (getSerde ().serialize (next ), type , ctx );
205
205
docs .add (doc );
206
206
documentsAndErrors .add (doc );
207
207
}
@@ -249,7 +249,7 @@ private InternalRequest createReplaceDocumentRequest(final DocumentReplaceOption
249
249
250
250
protected <T > ResponseDeserializer <MultiDocumentEntity <DocumentUpdateEntity <T >>> replaceDocumentsResponseDeserializer (
251
251
final Class <T > returnType ) {
252
- return response -> {
252
+ return ( response , ctx ) -> {
253
253
final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <>();
254
254
final List <DocumentUpdateEntity <T >> docs = new ArrayList <>();
255
255
final List <ErrorEntity > errors = new ArrayList <>();
@@ -258,12 +258,12 @@ protected <T> ResponseDeserializer<MultiDocumentEntity<DocumentUpdateEntity<T>>>
258
258
for (final JsonNode next : body ) {
259
259
JsonNode isError = next .get (ArangoResponseField .ERROR_FIELD_NAME );
260
260
if (isError != null && isError .booleanValue ()) {
261
- final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class );
261
+ final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class , ctx );
262
262
errors .add (error );
263
263
documentsAndErrors .add (error );
264
264
} else {
265
265
Type type = constructParametricType (DocumentUpdateEntity .class , returnType );
266
- final DocumentUpdateEntity <T > doc = getSerde ().deserialize (next , type );
266
+ final DocumentUpdateEntity <T > doc = getSerde ().deserialize (next , type , ctx );
267
267
docs .add (doc );
268
268
documentsAndErrors .add (doc );
269
269
}
@@ -312,7 +312,7 @@ private InternalRequest createUpdateDocumentRequest(final DocumentUpdateOptions
312
312
313
313
protected <T > ResponseDeserializer <MultiDocumentEntity <DocumentUpdateEntity <T >>> updateDocumentsResponseDeserializer (
314
314
final Class <T > returnType ) {
315
- return response -> {
315
+ return ( response , ctx ) -> {
316
316
final MultiDocumentEntity <DocumentUpdateEntity <T >> multiDocument = new MultiDocumentEntity <>();
317
317
final List <DocumentUpdateEntity <T >> docs = new ArrayList <>();
318
318
final List <ErrorEntity > errors = new ArrayList <>();
@@ -321,12 +321,12 @@ protected <T> ResponseDeserializer<MultiDocumentEntity<DocumentUpdateEntity<T>>>
321
321
for (final JsonNode next : body ) {
322
322
JsonNode isError = next .get (ArangoResponseField .ERROR_FIELD_NAME );
323
323
if (isError != null && isError .booleanValue ()) {
324
- final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class );
324
+ final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class , ctx );
325
325
errors .add (error );
326
326
documentsAndErrors .add (error );
327
327
} else {
328
328
Type type = constructParametricType (DocumentUpdateEntity .class , returnType );
329
- final DocumentUpdateEntity <T > doc = getSerde ().deserialize (next , type );
329
+ final DocumentUpdateEntity <T > doc = getSerde ().deserialize (next , type , ctx );
330
330
docs .add (doc );
331
331
documentsAndErrors .add (doc );
332
332
}
@@ -368,7 +368,7 @@ private InternalRequest createDeleteDocumentRequest(final DocumentDeleteOptions
368
368
369
369
protected <T > ResponseDeserializer <MultiDocumentEntity <DocumentDeleteEntity <T >>> deleteDocumentsResponseDeserializer (
370
370
final Class <T > userDataClass ) {
371
- return response -> {
371
+ return ( response , ctx ) -> {
372
372
final MultiDocumentEntity <DocumentDeleteEntity <T >> multiDocument = new MultiDocumentEntity <>();
373
373
final List <DocumentDeleteEntity <T >> docs = new ArrayList <>();
374
374
final List <ErrorEntity > errors = new ArrayList <>();
@@ -377,12 +377,12 @@ protected <T> ResponseDeserializer<MultiDocumentEntity<DocumentDeleteEntity<T>>>
377
377
for (final JsonNode next : body ) {
378
378
JsonNode isError = next .get (ArangoResponseField .ERROR_FIELD_NAME );
379
379
if (isError != null && isError .booleanValue ()) {
380
- final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class );
380
+ final ErrorEntity error = getSerde ().deserialize (next , ErrorEntity .class , ctx );
381
381
errors .add (error );
382
382
documentsAndErrors .add (error );
383
383
} else {
384
384
Type type = constructParametricType (DocumentDeleteEntity .class , userDataClass );
385
- final DocumentDeleteEntity <T > doc = getSerde ().deserialize (next , type );
385
+ final DocumentDeleteEntity <T > doc = getSerde ().deserialize (next , type , ctx );
386
386
docs .add (doc );
387
387
documentsAndErrors .add (doc );
388
388
}
@@ -413,7 +413,7 @@ protected InternalRequest deleteIndexRequest(final String id) {
413
413
}
414
414
415
415
protected ResponseDeserializer <String > deleteIndexResponseDeserializer () {
416
- return response -> getSerde ().deserialize (response .getBody (), "/id" , String .class );
416
+ return ( response , ctx ) -> getSerde ().deserialize (response .getBody (), "/id" , String .class , ctx );
417
417
}
418
418
419
419
private String createIndexId (final String id ) {
@@ -495,23 +495,23 @@ protected InternalRequest getIndexesRequest() {
495
495
}
496
496
497
497
protected ResponseDeserializer <Collection <IndexEntity >> getIndexesResponseDeserializer () {
498
- return response -> {
498
+ return ( response , ctx ) -> {
499
499
Collection <IndexEntity > indexes = new ArrayList <>();
500
500
for (JsonNode idx : getSerde ().parse (response .getBody (), "/indexes" )) {
501
501
if (!"inverted" .equals (idx .get ("type" ).textValue ())) {
502
- indexes .add (getSerde ().deserialize (idx , IndexEntity .class ));
502
+ indexes .add (getSerde ().deserialize (idx , IndexEntity .class , ctx ));
503
503
}
504
504
}
505
505
return indexes ;
506
506
};
507
507
}
508
508
509
509
protected ResponseDeserializer <Collection <InvertedIndexEntity >> getInvertedIndexesResponseDeserializer () {
510
- return response -> {
510
+ return ( response , ctx ) -> {
511
511
Collection <InvertedIndexEntity > indexes = new ArrayList <>();
512
512
for (JsonNode idx : getSerde ().parse (response .getBody (), "/indexes" )) {
513
513
if ("inverted" .equals (idx .get ("type" ).textValue ())) {
514
- indexes .add (getSerde ().deserialize (idx , InvertedIndexEntity .class ));
514
+ indexes .add (getSerde ().deserialize (idx , InvertedIndexEntity .class , ctx ));
515
515
}
516
516
}
517
517
return indexes ;
@@ -583,8 +583,8 @@ protected InternalRequest getPermissionsRequest(final String user) {
583
583
}
584
584
585
585
protected ResponseDeserializer <Permissions > getPermissionsResponseDeserialzer () {
586
- return response -> getSerde ().deserialize (response .getBody (), ArangoResponseField .RESULT_JSON_POINTER ,
587
- Permissions .class );
586
+ return ( response , ctx ) -> getSerde ().deserialize (response .getBody (), ArangoResponseField .RESULT_JSON_POINTER ,
587
+ Permissions .class , ctx );
588
588
}
589
589
590
590
}
0 commit comments