Skip to content

Commit 2954d71

Browse files
committed
replaced Collection with Iterable in API arguments
1 parent b0dd98a commit 2954d71

File tree

25 files changed

+72
-69
lines changed

25 files changed

+72
-69
lines changed

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.arangodb</groupId>
88
<artifactId>arangodb-java-driver-parent</artifactId>
9-
<version>7.1.0</version>
9+
<version>7.2.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<name>core</name>

core/src/main/java/com/arangodb/ArangoCollection.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ MultiDocumentEntity<DocumentCreateEntity<RawData>> insertDocuments(
122122
* @see <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#create-document">API
123123
* Documentation</a>
124124
*/
125-
MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(Collection<?> values);
125+
MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(Iterable<?> values);
126126

127127
/**
128128
* Creates new documents from the given documents, unless there is already a document with the _key given. If no
@@ -135,7 +135,7 @@ MultiDocumentEntity<DocumentCreateEntity<RawData>> insertDocuments(
135135
* Documentation</a>
136136
*/
137137
MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(
138-
Collection<?> values, DocumentCreateOptions options);
138+
Iterable<?> values, DocumentCreateOptions options);
139139

140140
/**
141141
* Creates new documents from the given documents, unless there is already a document with the _key given. If no
@@ -149,15 +149,15 @@ MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(
149149
* Documentation</a>
150150
*/
151151
<T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
152-
Collection<? extends T> values, DocumentCreateOptions options, Class<T> type);
152+
Iterable<? extends T> values, DocumentCreateOptions options, Class<T> type);
153153

154154
/**
155155
* Bulk imports the given values into the collection.
156156
*
157157
* @param values A List of documents (POJO or {@link com.arangodb.util.RawData})
158158
* @return information about the import
159159
*/
160-
DocumentImportEntity importDocuments(Collection<?> values);
160+
DocumentImportEntity importDocuments(Iterable<?> values);
161161

162162
/**
163163
* Bulk imports the given values into the collection.
@@ -166,7 +166,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
166166
* @param options Additional options, can be null
167167
* @return information about the import
168168
*/
169-
DocumentImportEntity importDocuments(Collection<?> values, DocumentImportOptions options);
169+
DocumentImportEntity importDocuments(Iterable<?> values, DocumentImportOptions options);
170170

171171
/**
172172
* Bulk imports the given values into the collection.
@@ -215,7 +215,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
215215
* @param type The type of the documents (POJO or {@link com.arangodb.util.RawData})
216216
* @return the documents and possible errors
217217
*/
218-
<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type);
218+
<T> MultiDocumentEntity<T> getDocuments(Iterable<String> keys, Class<T> type);
219219

220220
/**
221221
* Retrieves multiple documents with the given {@code _key} from the collection.
@@ -225,7 +225,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
225225
* @param options Additional options, can be null
226226
* @return the documents and possible errors
227227
*/
228-
<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options);
228+
<T> MultiDocumentEntity<T> getDocuments(Iterable<String> keys, Class<T> type, DocumentReadOptions options);
229229

230230
/**
231231
* Replaces the document with {@code key} with the one in the body, provided there is such a document and no
@@ -305,7 +305,7 @@ MultiDocumentEntity<DocumentUpdateEntity<RawData>> replaceDocuments(
305305
* <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#replace-documents">API
306306
* Documentation</a>
307307
*/
308-
MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(Collection<?> values);
308+
MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(Iterable<?> values);
309309

310310
/**
311311
* Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
@@ -319,7 +319,7 @@ MultiDocumentEntity<DocumentUpdateEntity<RawData>> replaceDocuments(
319319
* Documentation</a>
320320
*/
321321
MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(
322-
Collection<?> values, DocumentReplaceOptions options);
322+
Iterable<?> values, DocumentReplaceOptions options);
323323

324324
/**
325325
* Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
@@ -334,7 +334,7 @@ MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(
334334
* Documentation</a>
335335
*/
336336
<T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(
337-
Collection<? extends T> values, DocumentReplaceOptions options, Class<T> type);
337+
Iterable<? extends T> values, DocumentReplaceOptions options, Class<T> type);
338338

339339
/**
340340
* Partially updates the document identified by document-key. The value must contain a document with the attributes
@@ -421,7 +421,7 @@ MultiDocumentEntity<DocumentUpdateEntity<RawData>> updateDocuments(
421421
* <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#update-documents">API
422422
* Documentation</a>
423423
*/
424-
MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(Collection<?> values);
424+
MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(Iterable<?> values);
425425

426426
/**
427427
* Partially updates documents, the documents to update are specified by the _key attributes in the objects on
@@ -437,7 +437,7 @@ MultiDocumentEntity<DocumentUpdateEntity<RawData>> updateDocuments(
437437
* Documentation</a>
438438
*/
439439
MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(
440-
Collection<?> values, DocumentUpdateOptions options);
440+
Iterable<?> values, DocumentUpdateOptions options);
441441

442442
/**
443443
* Partially updates documents, the documents to update are specified by the _key attributes in the objects on
@@ -454,7 +454,7 @@ MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(
454454
* Documentation</a>
455455
*/
456456
<T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(
457-
Collection<?> values, DocumentUpdateOptions options, Class<T> returnType);
457+
Iterable<?> values, DocumentUpdateOptions options, Class<T> returnType);
458458

459459
/**
460460
* Deletes the document with the given {@code key} from the collection.
@@ -525,7 +525,7 @@ MultiDocumentEntity<DocumentDeleteEntity<RawData>> deleteDocuments(
525525
* "https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#removes-multiple-documents">API
526526
* Documentation</a>
527527
*/
528-
MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Collection<?> values);
528+
MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Iterable<?> values);
529529

530530
/**
531531
* Deletes multiple documents from the collection.
@@ -538,7 +538,7 @@ MultiDocumentEntity<DocumentDeleteEntity<RawData>> deleteDocuments(
538538
* Documentation</a>
539539
*/
540540
MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(
541-
Collection<?> values, DocumentDeleteOptions options);
541+
Iterable<?> values, DocumentDeleteOptions options);
542542

543543
/**
544544
* Deletes multiple documents from the collection.
@@ -552,7 +552,7 @@ MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(
552552
* Documentation</a>
553553
*/
554554
<T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
555-
Collection<?> values, DocumentDeleteOptions options, Class<T> type);
555+
Iterable<?> values, DocumentDeleteOptions options, Class<T> type);
556556

557557
/**
558558
* Checks if the document exists by reading a single document head

core/src/main/java/com/arangodb/ArangoDatabase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public interface ArangoDatabase extends ArangoSerdeAccessor {
492492
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#create-a-graph">API
493493
* Documentation</a>
494494
*/
495-
GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions);
495+
GraphEntity createGraph(String name, Iterable<EdgeDefinition> edgeDefinitions);
496496

497497
/**
498498
* Create a new graph in the graph module. The creation of a graph requires the name of the graph and a definition
@@ -505,7 +505,7 @@ public interface ArangoDatabase extends ArangoSerdeAccessor {
505505
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#create-a-graph">API
506506
* Documentation</a>
507507
*/
508-
GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options);
508+
GraphEntity createGraph(String name, Iterable<EdgeDefinition> edgeDefinitions, GraphCreateOptions options);
509509

510510
/**
511511
* Lists all graphs known to the graph module

core/src/main/java/com/arangodb/ArangoGraph.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public interface ArangoGraph extends ArangoSerdeAccessor {
6868
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#create-a-graph">API
6969
* Documentation</a>
7070
*/
71-
GraphEntity create(Collection<EdgeDefinition> edgeDefinitions);
71+
GraphEntity create(Iterable<EdgeDefinition> edgeDefinitions);
7272

7373
/**
7474
* Creates the graph in the graph module. The creation of a graph requires the name of the graph and a definition of
@@ -80,7 +80,7 @@ public interface ArangoGraph extends ArangoSerdeAccessor {
8080
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#create-a-graph">API
8181
* Documentation</a>
8282
*/
83-
GraphEntity create(Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options);
83+
GraphEntity create(Iterable<EdgeDefinition> edgeDefinitions, GraphCreateOptions options);
8484

8585
/**
8686
* Deletes the graph from the database.

core/src/main/java/com/arangodb/internal/ArangoCollectionImpl.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,33 +82,33 @@ public MultiDocumentEntity<DocumentCreateEntity<RawData>> insertDocuments(RawDat
8282
}
8383

8484
@Override
85-
public MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(final Collection<?> values) {
85+
public MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(final Iterable<?> values) {
8686
return insertDocuments(values, new DocumentCreateOptions());
8787
}
8888

8989
@Override
9090
public MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(
91-
final Collection<?> values, final DocumentCreateOptions options) {
91+
final Iterable<?> values, final DocumentCreateOptions options) {
9292
return executor
9393
.execute(insertDocumentsRequest(values, options),
9494
insertDocumentsResponseDeserializer(Void.class));
9595
}
9696

9797
@Override
98-
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<? extends T> values,
98+
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Iterable<? extends T> values,
9999
DocumentCreateOptions options,
100100
Class<T> type) {
101101
return executor
102102
.execute(insertDocumentsRequest(values, options), insertDocumentsResponseDeserializer(type));
103103
}
104104

105105
@Override
106-
public DocumentImportEntity importDocuments(final Collection<?> values) {
106+
public DocumentImportEntity importDocuments(final Iterable<?> values) {
107107
return importDocuments(values, new DocumentImportOptions());
108108
}
109109

110110
@Override
111-
public DocumentImportEntity importDocuments(final Collection<?> values, final DocumentImportOptions options) {
111+
public DocumentImportEntity importDocuments(final Iterable<?> values, final DocumentImportOptions options) {
112112
return executor.execute(importDocumentsRequest(values, options), DocumentImportEntity.class);
113113
}
114114

@@ -151,13 +151,13 @@ public <T> T getDocument(final String key, final Class<T> type, final DocumentRe
151151
}
152152

153153
@Override
154-
public <T> MultiDocumentEntity<T> getDocuments(final Collection<String> keys, final Class<T> type) {
154+
public <T> MultiDocumentEntity<T> getDocuments(final Iterable<String> keys, final Class<T> type) {
155155
return getDocuments(keys, type, new DocumentReadOptions());
156156
}
157157

158158
@Override
159159
public <T> MultiDocumentEntity<T> getDocuments(
160-
final Collection<String> keys, final Class<T> type, final DocumentReadOptions options) {
160+
final Iterable<String> keys, final Class<T> type, final DocumentReadOptions options) {
161161
return executor.execute(getDocumentsRequest(keys, options), getDocumentsResponseDeserializer(type));
162162
}
163163

@@ -196,19 +196,19 @@ public MultiDocumentEntity<DocumentUpdateEntity<RawData>> replaceDocuments(RawDa
196196
}
197197

198198
@Override
199-
public MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(final Collection<?> values) {
199+
public MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(final Iterable<?> values) {
200200
return replaceDocuments(values, new DocumentReplaceOptions());
201201
}
202202

203203
@Override
204204
public MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(
205-
final Collection<?> values, final DocumentReplaceOptions options) {
205+
final Iterable<?> values, final DocumentReplaceOptions options) {
206206
return executor.execute(replaceDocumentsRequest(values, options),
207207
replaceDocumentsResponseDeserializer(Void.class));
208208
}
209209

210210
@Override
211-
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<? extends T> values,
211+
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Iterable<? extends T> values,
212212
DocumentReplaceOptions options,
213213
Class<T> type) {
214214
return executor.execute(replaceDocumentsRequest(values, options), replaceDocumentsResponseDeserializer(type));
@@ -250,19 +250,19 @@ public MultiDocumentEntity<DocumentUpdateEntity<RawData>> updateDocuments(RawDat
250250
}
251251

252252
@Override
253-
public MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(final Collection<?> values) {
253+
public MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(final Iterable<?> values) {
254254
return updateDocuments(values, new DocumentUpdateOptions());
255255
}
256256

257257
@Override
258258
public MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(
259-
final Collection<?> values, final DocumentUpdateOptions options) {
259+
final Iterable<?> values, final DocumentUpdateOptions options) {
260260
return updateDocuments(values, options, Void.class);
261261
}
262262

263263
@Override
264264
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(
265-
final Collection<?> values, final DocumentUpdateOptions options, final Class<T> returnType) {
265+
final Iterable<?> values, final DocumentUpdateOptions options, final Class<T> returnType) {
266266
return executor
267267
.execute(updateDocumentsRequest(values, options), updateDocumentsResponseDeserializer(returnType));
268268
}
@@ -299,19 +299,19 @@ public MultiDocumentEntity<DocumentDeleteEntity<RawData>> deleteDocuments(RawDat
299299
}
300300

301301
@Override
302-
public MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(final Collection<?> values) {
302+
public MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(final Iterable<?> values) {
303303
return deleteDocuments(values, new DocumentDeleteOptions());
304304
}
305305

306306
@Override
307307
public MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(
308-
final Collection<?> values, final DocumentDeleteOptions options) {
308+
final Iterable<?> values, final DocumentDeleteOptions options) {
309309
return deleteDocuments(values, options, Void.class);
310310
}
311311

312312
@Override
313313
public <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
314-
final Collection<?> values, final DocumentDeleteOptions options, final Class<T> type) {
314+
final Iterable<?> values, final DocumentDeleteOptions options, final Class<T> type) {
315315
return executor.execute(deleteDocumentsRequest(values, options), deleteDocumentsResponseDeserializer(type));
316316
}
317317

core/src/main/java/com/arangodb/internal/ArangoDatabaseImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,13 @@ public ArangoGraph graph(final String name) {
303303
}
304304

305305
@Override
306-
public GraphEntity createGraph(final String name, final Collection<EdgeDefinition> edgeDefinitions) {
306+
public GraphEntity createGraph(final String name, final Iterable<EdgeDefinition> edgeDefinitions) {
307307
return createGraph(name, edgeDefinitions, new GraphCreateOptions());
308308
}
309309

310310
@Override
311311
public GraphEntity createGraph(
312-
final String name, final Collection<EdgeDefinition> edgeDefinitions, final GraphCreateOptions options) {
312+
final String name, final Iterable<EdgeDefinition> edgeDefinitions, final GraphCreateOptions options) {
313313
return executor.execute(createGraphRequest(name, edgeDefinitions, options), createGraphResponseDeserializer());
314314
}
315315

core/src/main/java/com/arangodb/internal/ArangoGraphImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ public boolean exists() {
5656
}
5757

5858
@Override
59-
public GraphEntity create(final Collection<EdgeDefinition> edgeDefinitions) {
59+
public GraphEntity create(final Iterable<EdgeDefinition> edgeDefinitions) {
6060
return db().createGraph(name(), edgeDefinitions);
6161
}
6262

6363
@Override
64-
public GraphEntity create(final Collection<EdgeDefinition> edgeDefinitions, final GraphCreateOptions options) {
64+
public GraphEntity create(final Iterable<EdgeDefinition> edgeDefinitions, final GraphCreateOptions options) {
6565
return db().createGraph(name(), edgeDefinitions, options);
6666
}
6767

0 commit comments

Comments
 (0)