Class CSVBeanMapping.Builder

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

public static final class CSVBeanMapping.Builder extends Object
Mutable builder for incrementally constructing an immutable CSVBeanMapping while its field mappings are being parsed.
  • Method Details

    • beanName

      public CSVBeanMapping.Builder beanName(String newBeanName)
      Sets the mapped bean's user defined name.
      Parameters:
      newBeanName - the mapped bean's user defined name
      Returns:
      this builder
    • beanClass

      public CSVBeanMapping.Builder beanClass(String newBeanClass)
      Sets the mapped bean's fully qualified class name.
      Parameters:
      newBeanClass - the mapped bean's class name
      Returns:
      this builder
    • csvHeaderPresent

      public CSVBeanMapping.Builder csvHeaderPresent(boolean newCsvHeaderPresent)
      Sets the flag which indicates whether a header row is present in the mapped CSV file or stream.
      Parameters:
      newCsvHeaderPresent - the flag value to set
      Returns:
      this builder
    • addFieldMapping

      public CSVBeanMapping.Builder addFieldMapping(CSVFieldMapping fieldMapping)
      Adds a new field mapping for this bean mapping.
      Parameters:
      fieldMapping - the field mapping to add
      Returns:
      this builder
    • build

      public CSVBeanMapping build()
      Builds the immutable bean mapping.
      Returns:
      the built bean mapping