Class CSVFieldMapping.Builder

java.lang.Object
org.csvobjects.csv.mapping.CSVFieldMapping.Builder
Enclosing class:
CSVFieldMapping

public static final class CSVFieldMapping.Builder extends Object
Mutable builder for incrementally constructing an immutable CSVFieldMapping from its declarative (parse-time) attributes. The resolved attributes (formatter and beanReference) are attached later via the with* methods on the built instance.
  • Method Details

    • fieldName

      public CSVFieldMapping.Builder fieldName(String newFieldName)
      Sets the user defined name of this field.
      Parameters:
      newFieldName - the name of this field
      Returns:
      this builder
    • fieldType

      public CSVFieldMapping.Builder fieldType(String newFieldType)
      Sets the fully qualified Java type name of this field.
      Parameters:
      newFieldType - the Java type name of this field
      Returns:
      this builder
    • fieldPosition

      public CSVFieldMapping.Builder fieldPosition(int newFieldPosition)
      Sets this field's position in the CSV line. Field positions start at 0.
      Parameters:
      newFieldPosition - the field's position in the CSV line
      Returns:
      this builder
    • attributeName

      public CSVFieldMapping.Builder attributeName(String newAttributeName)
      Sets the mapped POJO's attribute name corresponding to this field.
      Parameters:
      newAttributeName - the mapped POJO's attribute name
      Returns:
      this builder
    • reformatterName

      public CSVFieldMapping.Builder reformatterName(String newReformatterName)
      Sets the declarative name of the formatter attached to this field.
      Parameters:
      newReformatterName - the declarative formatter name to set
      Returns:
      this builder
    • beanReferenceName

      public CSVFieldMapping.Builder beanReferenceName(String newBeanReferenceName)
      Sets the declarative name of a referenced bean mapping for this field.
      Parameters:
      newBeanReferenceName - the declarative name of the referenced bean
      Returns:
      this builder
    • build

      public CSVFieldMapping build()
      Builds the immutable field mapping. The resolved formatter and beanReference attributes start unset (null).
      Returns:
      the built field mapping