30
30
import co .elastic .clients .util .ObjectBuilder ;
31
31
import co .elastic .clients .util .WithJsonObjectBuilderBase ;
32
32
import jakarta .json .stream .JsonGenerator ;
33
- import java .lang .Boolean ;
34
33
import java .lang .Integer ;
35
34
import java .lang .String ;
36
35
import java .util .List ;
@@ -66,10 +65,10 @@ public class FingerprintAnalyzer implements AnalyzerVariant, JsonpSerializable {
66
65
@ Nullable
67
66
private final String version ;
68
67
69
- private final int maxOutputSize ;
70
-
71
- private final boolean preserveOriginal ;
68
+ @ Nullable
69
+ private final Integer maxOutputSize ;
72
70
71
+ @ Nullable
73
72
private final String separator ;
74
73
75
74
private final List <String > stopwords ;
@@ -82,9 +81,8 @@ public class FingerprintAnalyzer implements AnalyzerVariant, JsonpSerializable {
82
81
private FingerprintAnalyzer (Builder builder ) {
83
82
84
83
this .version = builder .version ;
85
- this .maxOutputSize = ApiTypeHelper .requireNonNull (builder .maxOutputSize , this , "maxOutputSize" );
86
- this .preserveOriginal = ApiTypeHelper .requireNonNull (builder .preserveOriginal , this , "preserveOriginal" );
87
- this .separator = ApiTypeHelper .requireNonNull (builder .separator , this , "separator" );
84
+ this .maxOutputSize = builder .maxOutputSize ;
85
+ this .separator = builder .separator ;
88
86
this .stopwords = ApiTypeHelper .unmodifiable (builder .stopwords );
89
87
this .stopwordsPath = builder .stopwordsPath ;
90
88
@@ -104,41 +102,49 @@ public Analyzer.Kind _analyzerKind() {
104
102
105
103
/**
106
104
* API name: {@code version}
105
+ *
106
+ * @deprecated 7.14.0
107
107
*/
108
+ @ Deprecated
108
109
@ Nullable
109
110
public final String version () {
110
111
return this .version ;
111
112
}
112
113
113
114
/**
114
- * Required - API name: {@code max_output_size}
115
+ * The maximum token size to emit. Tokens larger than this size will be
116
+ * discarded. Defaults to <code>255</code>
117
+ * <p>
118
+ * API name: {@code max_output_size}
115
119
*/
116
- public final int maxOutputSize () {
120
+ @ Nullable
121
+ public final Integer maxOutputSize () {
117
122
return this .maxOutputSize ;
118
123
}
119
124
120
125
/**
121
- * Required - API name: {@code preserve_original}
122
- */
123
- public final boolean preserveOriginal () {
124
- return this .preserveOriginal ;
125
- }
126
-
127
- /**
128
- * Required - API name: {@code separator}
126
+ * The character to use to concatenate the terms. Defaults to a space.
127
+ * <p>
128
+ * API name: {@code separator}
129
129
*/
130
+ @ Nullable
130
131
public final String separator () {
131
132
return this .separator ;
132
133
}
133
134
134
135
/**
136
+ * A pre-defined stop words list like <code>_english_</code> or an array
137
+ * containing a list of stop words. Defaults to <code>_none_</code>.
138
+ * <p>
135
139
* API name: {@code stopwords}
136
140
*/
137
141
public final List <String > stopwords () {
138
142
return this .stopwords ;
139
143
}
140
144
141
145
/**
146
+ * The path to a file containing stop words.
147
+ * <p>
142
148
* API name: {@code stopwords_path}
143
149
*/
144
150
@ Nullable
@@ -164,15 +170,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
164
170
generator .write (this .version );
165
171
166
172
}
167
- generator .writeKey ("max_output_size" );
168
- generator .write (this .maxOutputSize );
169
-
170
- generator .writeKey ("preserve_original" );
171
- generator .write (this .preserveOriginal );
173
+ if (this .maxOutputSize != null ) {
174
+ generator .writeKey ("max_output_size" );
175
+ generator .write (this .maxOutputSize );
172
176
173
- generator .writeKey ("separator" );
174
- generator .write (this .separator );
177
+ }
178
+ if (this .separator != null ) {
179
+ generator .writeKey ("separator" );
180
+ generator .write (this .separator );
175
181
182
+ }
176
183
if (ApiTypeHelper .isDefined (this .stopwords )) {
177
184
generator .writeKey ("stopwords" );
178
185
generator .writeStartArray ();
@@ -208,10 +215,10 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
208
215
@ Nullable
209
216
private String version ;
210
217
218
+ @ Nullable
211
219
private Integer maxOutputSize ;
212
220
213
- private Boolean preserveOriginal ;
214
-
221
+ @ Nullable
215
222
private String separator ;
216
223
217
224
@ Nullable
@@ -222,37 +229,40 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
222
229
223
230
/**
224
231
* API name: {@code version}
232
+ *
233
+ * @deprecated 7.14.0
225
234
*/
235
+ @ Deprecated
226
236
public final Builder version (@ Nullable String value ) {
227
237
this .version = value ;
228
238
return this ;
229
239
}
230
240
231
241
/**
232
- * Required - API name: {@code max_output_size}
242
+ * The maximum token size to emit. Tokens larger than this size will be
243
+ * discarded. Defaults to <code>255</code>
244
+ * <p>
245
+ * API name: {@code max_output_size}
233
246
*/
234
- public final Builder maxOutputSize (int value ) {
247
+ public final Builder maxOutputSize (@ Nullable Integer value ) {
235
248
this .maxOutputSize = value ;
236
249
return this ;
237
250
}
238
251
239
252
/**
240
- * Required - API name: {@code preserve_original}
241
- */
242
- public final Builder preserveOriginal (boolean value ) {
243
- this .preserveOriginal = value ;
244
- return this ;
245
- }
246
-
247
- /**
248
- * Required - API name: {@code separator}
253
+ * The character to use to concatenate the terms. Defaults to a space.
254
+ * <p>
255
+ * API name: {@code separator}
249
256
*/
250
- public final Builder separator (String value ) {
257
+ public final Builder separator (@ Nullable String value ) {
251
258
this .separator = value ;
252
259
return this ;
253
260
}
254
261
255
262
/**
263
+ * A pre-defined stop words list like <code>_english_</code> or an array
264
+ * containing a list of stop words. Defaults to <code>_none_</code>.
265
+ * <p>
256
266
* API name: {@code stopwords}
257
267
* <p>
258
268
* Adds all elements of <code>list</code> to <code>stopwords</code>.
@@ -263,6 +273,9 @@ public final Builder stopwords(List<String> list) {
263
273
}
264
274
265
275
/**
276
+ * A pre-defined stop words list like <code>_english_</code> or an array
277
+ * containing a list of stop words. Defaults to <code>_none_</code>.
278
+ * <p>
266
279
* API name: {@code stopwords}
267
280
* <p>
268
281
* Adds one or more values to <code>stopwords</code>.
@@ -273,6 +286,8 @@ public final Builder stopwords(String value, String... values) {
273
286
}
274
287
275
288
/**
289
+ * The path to a file containing stop words.
290
+ * <p>
276
291
* API name: {@code stopwords_path}
277
292
*/
278
293
public final Builder stopwordsPath (@ Nullable String value ) {
@@ -310,7 +325,6 @@ protected static void setupFingerprintAnalyzerDeserializer(ObjectDeserializer<Fi
310
325
311
326
op .add (Builder ::version , JsonpDeserializer .stringDeserializer (), "version" );
312
327
op .add (Builder ::maxOutputSize , JsonpDeserializer .integerDeserializer (), "max_output_size" );
313
- op .add (Builder ::preserveOriginal , JsonpDeserializer .booleanDeserializer (), "preserve_original" );
314
328
op .add (Builder ::separator , JsonpDeserializer .stringDeserializer (), "separator" );
315
329
op .add (Builder ::stopwords , JsonpDeserializer .arrayDeserializer (JsonpDeserializer .stringDeserializer ()),
316
330
"stopwords" );
0 commit comments