1
1
/*
2
- * (C) Copyright IBM Corp. 2019 .
2
+ * (C) Copyright IBM Corp. 2020 .
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5
5
* the License. You may obtain a copy of the License at
19
19
*/
20
20
public class FederatedQueryOptions extends GenericModel {
21
21
22
- private String environmentId ;
23
- private String filter ;
24
- private String query ;
25
- private String naturalLanguageQuery ;
26
- private Boolean passages ;
27
- private String aggregation ;
28
- private Long count ;
29
- private String xReturn ;
30
- private Long offset ;
31
- private String sort ;
32
- private Boolean highlight ;
33
- private String passagesFields ;
34
- private Long passagesCount ;
35
- private Long passagesCharacters ;
36
- private Boolean deduplicate ;
37
- private String deduplicateField ;
38
- private Boolean similar ;
39
- private String similarDocumentIds ;
40
- private String similarFields ;
41
- private String bias ;
42
- private String collectionIds ;
43
- private Boolean xWatsonLoggingOptOut ;
22
+ protected String environmentId ;
23
+ protected String collectionIds ;
24
+ protected String filter ;
25
+ protected String query ;
26
+ protected String naturalLanguageQuery ;
27
+ protected Boolean passages ;
28
+ protected String aggregation ;
29
+ protected Long count ;
30
+ protected String xReturn ;
31
+ protected Long offset ;
32
+ protected String sort ;
33
+ protected Boolean highlight ;
34
+ protected String passagesFields ;
35
+ protected Long passagesCount ;
36
+ protected Long passagesCharacters ;
37
+ protected Boolean deduplicate ;
38
+ protected String deduplicateField ;
39
+ protected Boolean similar ;
40
+ protected String similarDocumentIds ;
41
+ protected String similarFields ;
42
+ protected String bias ;
43
+ protected Boolean xWatsonLoggingOptOut ;
44
44
45
45
/**
46
46
* Builder.
47
47
*/
48
48
public static class Builder {
49
49
private String environmentId ;
50
+ private String collectionIds ;
50
51
private String filter ;
51
52
private String query ;
52
53
private String naturalLanguageQuery ;
@@ -66,11 +67,11 @@ public static class Builder {
66
67
private String similarDocumentIds ;
67
68
private String similarFields ;
68
69
private String bias ;
69
- private String collectionIds ;
70
70
private Boolean xWatsonLoggingOptOut ;
71
71
72
72
private Builder (FederatedQueryOptions federatedQueryOptions ) {
73
73
this .environmentId = federatedQueryOptions .environmentId ;
74
+ this .collectionIds = federatedQueryOptions .collectionIds ;
74
75
this .filter = federatedQueryOptions .filter ;
75
76
this .query = federatedQueryOptions .query ;
76
77
this .naturalLanguageQuery = federatedQueryOptions .naturalLanguageQuery ;
@@ -90,7 +91,6 @@ private Builder(FederatedQueryOptions federatedQueryOptions) {
90
91
this .similarDocumentIds = federatedQueryOptions .similarDocumentIds ;
91
92
this .similarFields = federatedQueryOptions .similarFields ;
92
93
this .bias = federatedQueryOptions .bias ;
93
- this .collectionIds = federatedQueryOptions .collectionIds ;
94
94
this .xWatsonLoggingOptOut = federatedQueryOptions .xWatsonLoggingOptOut ;
95
95
}
96
96
@@ -104,9 +104,11 @@ public Builder() {
104
104
* Instantiates a new builder with required properties.
105
105
*
106
106
* @param environmentId the environmentId
107
+ * @param collectionIds the collectionIds
107
108
*/
108
- public Builder (String environmentId ) {
109
+ public Builder (String environmentId , String collectionIds ) {
109
110
this .environmentId = environmentId ;
111
+ this .collectionIds = collectionIds ;
110
112
}
111
113
112
114
/**
@@ -129,6 +131,17 @@ public Builder environmentId(String environmentId) {
129
131
return this ;
130
132
}
131
133
134
+ /**
135
+ * Set the collectionIds.
136
+ *
137
+ * @param collectionIds the collectionIds
138
+ * @return the FederatedQueryOptions builder
139
+ */
140
+ public Builder collectionIds (String collectionIds ) {
141
+ this .collectionIds = collectionIds ;
142
+ return this ;
143
+ }
144
+
132
145
/**
133
146
* Set the filter.
134
147
*
@@ -338,17 +351,6 @@ public Builder bias(String bias) {
338
351
return this ;
339
352
}
340
353
341
- /**
342
- * Set the collectionIds.
343
- *
344
- * @param collectionIds the collectionIds
345
- * @return the FederatedQueryOptions builder
346
- */
347
- public Builder collectionIds (String collectionIds ) {
348
- this .collectionIds = collectionIds ;
349
- return this ;
350
- }
351
-
352
354
/**
353
355
* Set the xWatsonLoggingOptOut.
354
356
*
@@ -361,10 +363,13 @@ public Builder xWatsonLoggingOptOut(Boolean xWatsonLoggingOptOut) {
361
363
}
362
364
}
363
365
364
- private FederatedQueryOptions (Builder builder ) {
366
+ protected FederatedQueryOptions (Builder builder ) {
365
367
com .ibm .cloud .sdk .core .util .Validator .notEmpty (builder .environmentId ,
366
368
"environmentId cannot be empty" );
369
+ com .ibm .cloud .sdk .core .util .Validator .notNull (builder .collectionIds ,
370
+ "collectionIds cannot be null" );
367
371
environmentId = builder .environmentId ;
372
+ collectionIds = builder .collectionIds ;
368
373
filter = builder .filter ;
369
374
query = builder .query ;
370
375
naturalLanguageQuery = builder .naturalLanguageQuery ;
@@ -384,7 +389,6 @@ private FederatedQueryOptions(Builder builder) {
384
389
similarDocumentIds = builder .similarDocumentIds ;
385
390
similarFields = builder .similarFields ;
386
391
bias = builder .bias ;
387
- collectionIds = builder .collectionIds ;
388
392
xWatsonLoggingOptOut = builder .xWatsonLoggingOptOut ;
389
393
}
390
394
@@ -408,6 +412,17 @@ public String environmentId() {
408
412
return environmentId ;
409
413
}
410
414
415
+ /**
416
+ * Gets the collectionIds.
417
+ *
418
+ * A comma-separated list of collection IDs to be queried against.
419
+ *
420
+ * @return the collectionIds
421
+ */
422
+ public String collectionIds () {
423
+ return collectionIds ;
424
+ }
425
+
411
426
/**
412
427
* Gets the filter.
413
428
*
@@ -640,17 +655,6 @@ public String bias() {
640
655
return bias ;
641
656
}
642
657
643
- /**
644
- * Gets the collectionIds.
645
- *
646
- * A comma-separated list of collection IDs to be queried against.
647
- *
648
- * @return the collectionIds
649
- */
650
- public String collectionIds () {
651
- return collectionIds ;
652
- }
653
-
654
658
/**
655
659
* Gets the xWatsonLoggingOptOut.
656
660
*
0 commit comments