Skip to content

Commit fc35758

Browse files
author
a-brandt
committed
added options "complete" and "details"
1 parent 5eb6e31 commit fc35758

File tree

1 file changed

+60
-38
lines changed

1 file changed

+60
-38
lines changed

src/main/java/com/arangodb/util/ImportOptions.java

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,22 @@
22

33
import java.util.Map;
44

5-
import com.arangodb.entity.CollectionType;
6-
75
public class ImportOptions implements OptionsInterface {
86

97
public enum OnDuplicate {
108
ERROR, UPDATE, REPLACE, IGNORE
119
}
1210

13-
private CollectionType createCollectionType;
1411
private Boolean overwrite;
1512
private Boolean waitForSync;
1613
private OnDuplicate onDuplicate;
14+
private Boolean complete;
15+
private Boolean details;
1716

1817
/**
19-
* createCollectionType (optional): If this parameter has a value of
20-
* document or edge, it will determine the type of collection that is going
21-
* to be created when the createCollection option is set to true. The
22-
* default value is document.
23-
*
24-
* @return
25-
*/
26-
public CollectionType getCreateCollectionType() {
27-
return createCollectionType;
28-
}
29-
30-
/**
31-
* createCollectionType (optional): If this parameter has a value of
32-
* document or edge, it will determine the type of collection that is going
33-
* to be created when the createCollection option is set to true. The
34-
* default value is document.
35-
*
36-
* @param createCollectionType
37-
* @return this ImportOptions object
38-
*/
39-
public ImportOptions setCreateCollectionType(CollectionType createCollectionType) {
40-
this.createCollectionType = createCollectionType;
41-
return this;
42-
}
43-
44-
/**
45-
* overwrite (optional): If this parameter has a value of true or yes, then
46-
* all data in the collection will be removed prior to the import. Note that
47-
* any existing index definitions will be preseved.
18+
* overwrite (optional): If this parameter has a value of true, then all
19+
* data in the collection will be removed prior to the import. Note that any
20+
* existing index definitions will be preseved.
4821
*
4922
* @return
5023
*/
@@ -53,9 +26,9 @@ public Boolean getOverwrite() {
5326
}
5427

5528
/**
56-
* overwrite (optional): If this parameter has a value of true or yes, then
57-
* all data in the collection will be removed prior to the import. Note that
58-
* any existing index definitions will be preseved.
29+
* overwrite (optional): If this parameter has a value of true, then all
30+
* data in the collection will be removed prior to the import. Note that any
31+
* existing index definitions will be preseved.
5932
*
6033
*
6134
* @param overwrite
@@ -136,13 +109,56 @@ public ImportOptions setOnDuplicate(OnDuplicate onDuplicate) {
136109
return this;
137110
}
138111

112+
/**
113+
* (optional) If set to true, it will make the whole import fail if any
114+
* error occurs. Otherwise the import will continue even if some documents
115+
* cannot be imported.
116+
*
117+
* @return
118+
*/
119+
public Boolean getComplete() {
120+
return complete;
121+
}
122+
123+
/**
124+
* (optional) If set to true, it will make the whole import fail if any
125+
* error occurs. Otherwise the import will continue even if some documents
126+
* cannot be imported.
127+
*
128+
* @param complete
129+
* @return this ImportOptions object
130+
*/
131+
public ImportOptions setComplete(Boolean complete) {
132+
this.complete = complete;
133+
return this;
134+
}
135+
136+
/**
137+
* (optional) If set to true, the result will include an attribute details
138+
* with details about documents that could not be imported.
139+
*
140+
* @return
141+
*/
142+
public Boolean getDetails() {
143+
return details;
144+
}
145+
146+
/**
147+
* (optional) If set to true, the result will include an attribute details
148+
* with details about documents that could not be imported.
149+
*
150+
* @param details
151+
* @return this ImportOptions object
152+
*/
153+
public ImportOptions setDetails(Boolean details) {
154+
this.details = details;
155+
return this;
156+
}
157+
139158
@Override
140159
public Map<String, Object> toMap() {
141160
MapBuilder mp = new MapBuilder();
142161

143-
if (createCollectionType != null) {
144-
mp.put("createCollectionType", createCollectionType.toString().toLowerCase());
145-
}
146162
if (overwrite != null) {
147163
mp.put("overwrite", overwrite);
148164
}
@@ -152,6 +168,12 @@ public Map<String, Object> toMap() {
152168
if (onDuplicate != null) {
153169
mp.put("onDuplicate", onDuplicate.toString().toLowerCase());
154170
}
171+
if (complete != null) {
172+
mp.put("complete", complete);
173+
}
174+
if (details != null) {
175+
mp.put("details", details);
176+
}
155177

156178
return mp.get();
157179
}

0 commit comments

Comments
 (0)