Class AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<?>>
- Type Parameters:
T- the type of the actual builder
- Direct Known Subclasses:
CsvRecordHandler.CsvRecordHandlerBuilder, NamedCsvRecordHandler.NamedCsvRecordHandlerBuilder, StringArrayHandler.StringArrayHandlerBuilder
- Enclosing class:
AbstractInternalCsvCallbackHandler<T>
Abstract builder for AbstractInternalCsvCallbackHandler subclasses.
This class is for internal use only and should not be used directly. It will be sealed in a future release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FieldModifierThe field modifier.protected intThe maximum number of fields a single record may have.protected intThe maximum number of characters a single field may have.protected intThe maximum number of characters a single record may have. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a new default instance. -
Method Summary
Modifier and TypeMethodDescriptionfieldModifier(FieldModifier fieldModifier) Sets the field modifier.maxFields(int maxFields) Defines the maximum number of fields a single record may have.maxFieldSize(int maxFieldSize) Defines the maximum number of characters a single field may have.maxRecordSize(int maxRecordSize) Defines the maximum number of characters a single record may have.protected abstract Tself()Method to be implemented by subclasses to return the correct type.
-
Field Details
-
maxFields
protected int maxFieldsThe maximum number of fields a single record may have. The default value is 16,384. -
maxFieldSize
protected int maxFieldSizeThe maximum number of characters a single field may have. The default value is 16,777,216. -
maxRecordSize
protected int maxRecordSizeThe maximum number of characters a single record may have. The default value is 67,108,864. -
fieldModifier
The field modifier. The default value isFieldModifiers.NOP.
-
-
Constructor Details
-
AbstractInternalCsvCallbackHandlerBuilder
protected AbstractInternalCsvCallbackHandlerBuilder()Constructs a new default instance.
-
-
Method Details
-
self
Method to be implemented by subclasses to return the correct type.- Returns:
- This object of subclass type.
-
maxFields
Defines the maximum number of fields a single record may have.
This constraint is enforced for all fields, including the header.
- Parameters:
maxFields- the maximum fields a record may have; must be > 0 (default: 16,384)- Returns:
- This updated object, allowing additional method calls to be chained together.
- Throws:
IllegalArgumentException- if the argument is less than 1
-
maxFieldSize
Defines the maximum number of characters a single field may have.
This constraint is enforced for all fields, including the header and comments. The size of the field is determined after field modifiers are applied.
In contrast to
CsvReader.CsvReaderBuilder.maxBufferSize(int)which enforces the maximum field size before the field modifier is applied, this constraint allows more precise control over the field size as field modifiers may have a significant impact on the field size.- Parameters:
maxFieldSize- the maximum field size; must be > 0 (default: 16,777,216)- Returns:
- This updated object, allowing additional method calls to be chained together.
- Throws:
IllegalArgumentException- if the argument is less than 1- See Also:
-
maxRecordSize
Defines the maximum number of characters a single record may have.
This constraint is enforced for all fields, including the header and comments. The size of the record is the sum of the sizes of all fields. The size of each field is determined after field modifiers are applied.
Make sure that
maxRecordSizeis >=maxFieldSize.- Parameters:
maxRecordSize- the maximum record size; must be > 0 (default: 67,108,864)- Returns:
- This updated object, allowing additional method calls to be chained together.
- Throws:
IllegalArgumentException- if the argument is less than 1- See Also:
-
fieldModifier
Sets the field modifier.- Parameters:
fieldModifier- the field modifier; must not benull(default:FieldModifiers.NOP)- Returns:
- This updated object, allowing additional method calls to be chained together.
- Throws:
NullPointerException- ifnullis passed
-