Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
small refactoring in ArrangoCollectionImpl
  • Loading branch information
limpid-kzonix committed Jan 2, 2019
commit b390736d0e53908d0a4bc7feecf82f84f04e0674
27 changes: 7 additions & 20 deletions src/main/java/com/arangodb/internal/ArangoCollectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ protected ArangoCollectionImpl(final ArangoDatabaseImpl db, final String name) {

@Override
public <T> DocumentCreateEntity<T> insertDocument(final T value) throws ArangoDBException {
final DocumentCreateOptions options = new DocumentCreateOptions();
return executor.execute(insertDocumentRequest(value, options),
insertDocumentResponseDeserializer(value, options));
return insertDocument(value, new DocumentCreateOptions());
}

@Override
Expand All @@ -84,9 +82,7 @@ public <T> DocumentCreateEntity<T> insertDocument(final T value, final DocumentC
@Override
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(final Collection<T> values)
throws ArangoDBException {
final DocumentCreateOptions params = new DocumentCreateOptions();
return executor.execute(insertDocumentsRequest(values, params),
insertDocumentsResponseDeserializer(values, params));
return insertDocuments(values, new DocumentCreateOptions());
}

@Override
Expand All @@ -111,8 +107,7 @@ public DocumentImportEntity importDocuments(final Collection<?> values, final Do

@Override
public DocumentImportEntity importDocuments(final String values) throws ArangoDBException {
return executor.execute(importDocumentsRequest(values, new DocumentImportOptions()),
DocumentImportEntity.class);
return importDocuments(values, new DocumentImportOptions());
}

@Override
Expand Down Expand Up @@ -161,9 +156,7 @@ public <T> MultiDocumentEntity<T> getDocuments(

@Override
public <T> DocumentUpdateEntity<T> replaceDocument(final String key, final T value) throws ArangoDBException {
final DocumentReplaceOptions options = new DocumentReplaceOptions();
return executor.execute(replaceDocumentRequest(key, value, options),
replaceDocumentResponseDeserializer(value, options));
return replaceDocument(key, value, new DocumentReplaceOptions());
}

@Override
Expand All @@ -178,9 +171,7 @@ public <T> DocumentUpdateEntity<T> replaceDocument(
@Override
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(final Collection<T> values)
throws ArangoDBException {
final DocumentReplaceOptions params = new DocumentReplaceOptions();
return executor.execute(replaceDocumentsRequest(values, params),
replaceDocumentsResponseDeserializer(values, params));
return replaceDocuments(values, new DocumentReplaceOptions());
}

@Override
Expand All @@ -194,9 +185,7 @@ public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(

@Override
public <T> DocumentUpdateEntity<T> updateDocument(final String key, final T value) throws ArangoDBException {
final DocumentUpdateOptions options = new DocumentUpdateOptions();
return executor.execute(updateDocumentRequest(key, value, options),
updateDocumentResponseDeserializer(value, options));
return updateDocument(key, value, new DocumentUpdateOptions());
}

@Override
Expand All @@ -211,9 +200,7 @@ public <T> DocumentUpdateEntity<T> updateDocument(
@Override
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(final Collection<T> values)
throws ArangoDBException {
final DocumentUpdateOptions params = new DocumentUpdateOptions();
return executor.execute(updateDocumentsRequest(values, params),
updateDocumentsResponseDeserializer(values, params));
return updateDocuments(values, new DocumentUpdateOptions());
}

@Override
Expand Down