2
2
3
3
import java .util .Map ;
4
4
5
- import com .arangodb .entity .CollectionType ;
6
-
7
5
public class ImportOptions implements OptionsInterface {
8
6
9
7
public enum OnDuplicate {
10
8
ERROR , UPDATE , REPLACE , IGNORE
11
9
}
12
10
13
- private CollectionType createCollectionType ;
14
11
private Boolean overwrite ;
15
12
private Boolean waitForSync ;
16
13
private OnDuplicate onDuplicate ;
14
+ private Boolean complete ;
15
+ private Boolean details ;
17
16
18
17
/**
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.
48
21
*
49
22
* @return
50
23
*/
@@ -53,9 +26,9 @@ public Boolean getOverwrite() {
53
26
}
54
27
55
28
/**
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.
59
32
*
60
33
*
61
34
* @param overwrite
@@ -136,13 +109,56 @@ public ImportOptions setOnDuplicate(OnDuplicate onDuplicate) {
136
109
return this ;
137
110
}
138
111
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
+
139
158
@ Override
140
159
public Map <String , Object > toMap () {
141
160
MapBuilder mp = new MapBuilder ();
142
161
143
- if (createCollectionType != null ) {
144
- mp .put ("createCollectionType" , createCollectionType .toString ().toLowerCase ());
145
- }
146
162
if (overwrite != null ) {
147
163
mp .put ("overwrite" , overwrite );
148
164
}
@@ -152,6 +168,12 @@ public Map<String, Object> toMap() {
152
168
if (onDuplicate != null ) {
153
169
mp .put ("onDuplicate" , onDuplicate .toString ().toLowerCase ());
154
170
}
171
+ if (complete != null ) {
172
+ mp .put ("complete" , complete );
173
+ }
174
+ if (details != null ) {
175
+ mp .put ("details" , details );
176
+ }
155
177
156
178
return mp .get ();
157
179
}
0 commit comments