|
2 | 2 |
|
3 | 3 | import java.util.ArrayList;
|
4 | 4 | import java.util.List;
|
| 5 | +import java.util.Objects; |
5 | 6 |
|
6 | 7 | import com.fasterxml.jackson.core.io.InputDecorator;
|
7 | 8 | import com.fasterxml.jackson.core.io.OutputDecorator;
|
@@ -82,32 +83,32 @@ public abstract class TSFBuilder<F extends JsonFactory,
|
82 | 83 | protected OutputDecorator _outputDecorator;
|
83 | 84 |
|
84 | 85 | /**
|
85 |
| - * Optional StreamReadConstraints. |
| 86 | + * {@link StreamReadConstraints} to use. |
86 | 87 | *
|
87 | 88 | * @since 2.15
|
88 | 89 | */
|
89 | 90 | protected StreamReadConstraints _streamReadConstraints;
|
90 | 91 |
|
91 | 92 | /**
|
92 |
| - * Optional StreamWriteConstraints. |
| 93 | + * {@link StreamWriteConstraints} to use. |
93 | 94 | *
|
94 | 95 | * @since 2.16
|
95 | 96 | */
|
96 | 97 | protected StreamWriteConstraints _streamWriteConstraints;
|
97 | 98 |
|
98 | 99 | /**
|
| 100 | + * {@link ErrorReportConfiguration} to use. |
| 101 | + * |
99 | 102 | * @since 2.16
|
100 | 103 | */
|
101 |
| - protected List<JsonGeneratorDecorator> _generatorDecorators; |
| 104 | + protected ErrorReportConfiguration _errorReportConfiguration; |
102 | 105 |
|
103 | 106 | /**
|
104 |
| - * Optional {@link ErrorReportConfiguration} to use. |
105 |
| - * |
106 | 107 | * @since 2.16
|
107 | 108 | */
|
108 |
| - protected ErrorReportConfiguration _errorReportConfiguration; |
| 109 | + protected List<JsonGeneratorDecorator> _generatorDecorators; |
| 110 | + |
109 | 111 |
|
110 |
| - /* |
111 | 112 | /**********************************************************************
|
112 | 113 | /* Construction
|
113 | 114 | /**********************************************************************
|
@@ -325,34 +326,35 @@ public B addDecorator(JsonGeneratorDecorator decorator) {
|
325 | 326 | * Sets the constraints for streaming reads.
|
326 | 327 | *
|
327 | 328 | * @param streamReadConstraints constraints for streaming reads
|
328 |
| - * @return this factory |
| 329 | + * @return this builder (for call chaining) |
329 | 330 | * @since 2.15
|
330 | 331 | */
|
331 | 332 | public B streamReadConstraints(StreamReadConstraints streamReadConstraints) {
|
332 |
| - _streamReadConstraints = streamReadConstraints; |
| 333 | + _streamReadConstraints = Objects.requireNonNull(streamReadConstraints); |
333 | 334 | return _this();
|
334 | 335 | }
|
335 | 336 |
|
336 | 337 | /**
|
337 |
| - * Sets the configuration for error tokens. |
| 338 | + * Sets the constraints for streaming writes. |
338 | 339 | *
|
339 |
| - * @param errorReportConfiguration configuration values used for handling errorneous token inputs. |
340 |
| - * @return this factory |
| 340 | + * @param streamWriteConstraints constraints for streaming reads |
| 341 | + * @return this builder (for call chaining) |
341 | 342 | * @since 2.16
|
342 | 343 | */
|
343 |
| - public B errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) { |
344 |
| - _errorReportConfiguration = errorReportConfiguration; |
| 344 | + public B streamWriteConstraints(StreamWriteConstraints streamWriteConstraints) { |
| 345 | + _streamWriteConstraints = Objects.requireNonNull(streamWriteConstraints); |
345 | 346 | return _this();
|
346 | 347 | }
|
| 348 | + |
347 | 349 | /**
|
348 |
| - * Sets the constraints for streaming writes. |
| 350 | + * Sets the configuration for error reporting. |
349 | 351 | *
|
350 |
| - * @param streamWriteConstraints constraints for streaming reads |
351 |
| - * @return this factory |
| 352 | + * @param errorReportConfiguration configuration values used for handling erroneous token inputs. |
| 353 | + * @return this builder (for call chaining) |
352 | 354 | * @since 2.16
|
353 | 355 | */
|
354 |
| - public B streamWriteConstraints(StreamWriteConstraints streamWriteConstraints) { |
355 |
| - _streamWriteConstraints = streamWriteConstraints; |
| 356 | + public B errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) { |
| 357 | + _errorReportConfiguration = Objects.requireNonNull(errorReportConfiguration); |
356 | 358 | return _this();
|
357 | 359 | }
|
358 | 360 |
|
|
0 commit comments