Class AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<?>>

java.lang.Object
de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T>
Type Parameters:
T - the type of the actual builder
Direct Known Subclasses:
CsvRecordHandler.CsvRecordHandlerBuilder, NamedCsvRecordHandler.NamedCsvRecordHandlerBuilder, StringArrayHandler.StringArrayHandlerBuilder
Enclosing class:
AbstractInternalCsvCallbackHandler<T>

public abstract static class AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<?>> extends Object

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

    Fields
    Modifier and Type
    Field
    Description
    protected FieldModifier
    The field modifier.
    protected int
    The maximum number of fields a single record may have.
    protected int
    The maximum number of characters a single field may have.
    protected int
    The maximum number of characters a single record may have.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new default instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    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 T
    Method to be implemented by subclasses to return the correct type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxFields

      protected int maxFields
      The maximum number of fields a single record may have. The default value is 16,384.
    • maxFieldSize

      protected int maxFieldSize
      The maximum number of characters a single field may have. The default value is 16,777,216.
    • maxRecordSize

      protected int maxRecordSize
      The maximum number of characters a single record may have. The default value is 67,108,864.
    • fieldModifier

      protected FieldModifier fieldModifier
      The field modifier. The default value is FieldModifiers.NOP.
  • Constructor Details

    • AbstractInternalCsvCallbackHandlerBuilder

      protected AbstractInternalCsvCallbackHandlerBuilder()
      Constructs a new default instance.
  • Method Details

    • self

      protected abstract T self()
      Method to be implemented by subclasses to return the correct type.
      Returns:
      This object of subclass type.
    • maxFields

      public T maxFields(int 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 greater than 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

      public T maxFieldSize(int 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 greater than 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

      public T maxRecordSize(int 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 maxRecordSize is greater than or equal to maxFieldSize.

      Parameters:
      maxRecordSize - the maximum record size, must be greater than 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

      public T fieldModifier(FieldModifier fieldModifier)
      Sets the field modifier.
      Parameters:
      fieldModifier - the field modifier, must not be null (default: FieldModifiers.NOP)
      Returns:
      This updated object, allowing additional method calls to be chained together.
      Throws:
      NullPointerException - if null is passed