Class CsvBuilder

    • Constructor Summary

      Constructors 
      Constructor Description
      CsvBuilder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static List<String> asFields​(String aRecord, char aDelimiter, CsvEscapeMode aCsvEscapeMode, boolean isTrim)
      Creates fields from the given record.
      static String asRecord​(Collection<Object> aFields, char aDelimiter, CsvEscapeMode aCsvEscapeMode)
      Creates a record from the given fields.
      static String[] asStrings​(String aRecord, char aDelimiterChar, CsvEscapeMode aCsvEscapeMode, boolean isTrim, String[] aCommentPrefixes)
      Splits a record into dedicated fields.
      void clearCommentPrefixes()
      Clears the prefixes used to identify CSV lines to be ignored.
      String[] getCommentPrefixes()
      Gets the prefixes used to identify CSV lines to be ignored.
      CsvEscapeMode getCsvEscapeMode()
      Gets the currently set CsvEscapeMode being used.
      char getDelimiter()
      Collection<Object> getFields()
      Retrieves the CSV elements from the CSV elements property.
      String getRecord()
      Retrieves the CSV line from the CSV line property.
      boolean isTrim()
      void setCommentPrefixes​(String... aCommentPrefixes)
      Sets the prefixes used to identify CSV lines to be ignored.
      void setCsvEscapeMode​(CsvEscapeMode aCsvEscapeMode)
      Sets the CsvEscapeMode to be used.
      void setDelimiter​(char aDelimiterChar)
      void setFields​(boolean... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(byte... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(char... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(double... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(float... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(int... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(long... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(short... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Boolean... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Byte... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Character... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Double... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Float... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Integer... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Long... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Object... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Short... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(String... aFields)
      Sets the CSV elements for the CSV elements property.
      void setFields​(Collection<Object> aFields)
      Sets the CSV elements for the CSV elements property.
      void setRecord​(String aRecord)
      Sets the CSV line for the CSV line property.
      void setTrim​(boolean isTrim)
      List<String> toFields()
      Creates a list of String elements from the CSV line being set via setRecord(String) or withRecord(String).
      String[] toFields​(String aRecord)
      Creates an array of Strings from the CSV line being set via setRecord(String) or withRecord(String).
      String toRecord()
      Creates a CSV line from the elements being set via setFields(String[]) or withFields(String[]).
      String toRecord​(boolean... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(byte... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(char... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(double... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(float... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(int... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(long... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(short... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Boolean... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Byte... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Character... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Double... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Float... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Integer... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Long... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Object... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Short... aFields)
      To record.
      String toRecord​(String... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toRecord​(Collection<Object> aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toString()
      The String being build by the builder upon the settings of the attributes.
      String toString​(Object... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toString​(String... aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String toString​(Collection<Object> aFields)
      Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).
      String[] toStrings()
      Creates an array of Strings from the CSV line being set via setRecord(String) or withRecord(String).
      String[] toStrings​(String aRecord)
      Convenience method for the toFields(String) method.
      CsvBuilder withCommentPrefixes​(String... aCommentPrefixes)
      Sets the prefixes used to identify CSV lines to be ignored.
      CsvBuilder withCsvEscapeMode​(CsvEscapeMode aCsvEscapeMode)
      Sets the rows CsvEscapeMode to use returns this builder as of the Builder-Pattern.
      CsvBuilder withDelimiter​(char aDelimiterChar)
      CsvBuilder withFields​(boolean... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(byte... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(char... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(double... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(float... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(int... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(long... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(short... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Boolean... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Byte... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Character... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Double... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Float... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Integer... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Long... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Object... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Short... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(String... aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withFields​(Collection<Object> aFields)
      Sets the CSV elements for the CSV elements property.
      CsvBuilder withRecord​(String aRecord)
      Sets the CSV line for the CSV line property.
      CsvBuilder withTrim​(boolean isTrim)
      • Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterProperty

        letDelimiter
      • Methods inherited from interface org.refcodes.mixin.TrimAccessor.TrimProperty

        letTrim
    • Constructor Detail

      • CsvBuilder

        public CsvBuilder()
    • Method Detail

      • setTrim

        public void setTrim​(boolean isTrim)
        Specified by:
        setTrim in interface org.refcodes.mixin.TrimAccessor.TrimMutator
      • isTrim

        public boolean isTrim()
        Specified by:
        isTrim in interface org.refcodes.mixin.TrimAccessor
      • setRecord

        public void setRecord​(String aRecord)
        Sets the CSV line for the CSV line property.
        Parameters:
        aRecord - The CSV line to be stored by the CSV line property.
      • getRecord

        public String getRecord()
        Retrieves the CSV line from the CSV line property.
        Returns:
        The CSV line stored by the CSV line property.
      • setFields

        public void setFields​(Object... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • getFields

        public Collection<Object> getFields()
        Retrieves the CSV elements from the CSV elements property.
        Returns:
        The CSV elements stored by the CSV elements property.
      • setFields

        public void setFields​(Collection<Object> aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • getDelimiter

        public char getDelimiter()
        Specified by:
        getDelimiter in interface org.refcodes.mixin.DelimiterAccessor
      • setDelimiter

        public void setDelimiter​(char aDelimiterChar)
        Specified by:
        setDelimiter in interface org.refcodes.mixin.DelimiterAccessor.DelimiterMutator
      • toRecord

        public String toRecord​(Object... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Collection<Object> aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(String... aFields)
                        throws IllegalStateException
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
        Throws:
        IllegalStateException
      • toStrings

        public String[] toStrings​(String aRecord)
        Convenience method for the toFields(String) method.
        Parameters:
        aRecord - The CSV line to be stored by the CSV line property.
        Returns:
        The elements created from the CSV line or null if the record is a comment.
      • setCommentPrefixes

        public void setCommentPrefixes​(String... aCommentPrefixes)
        Sets the prefixes used to identify CSV lines to be ignored.
        Specified by:
        setCommentPrefixes in interface CsvMixin
        Parameters:
        aCommentPrefixes - The prefixes used to identify CSV lines to be ignored.
      • getCommentPrefixes

        public String[] getCommentPrefixes()
        Gets the prefixes used to identify CSV lines to be ignored.
        Specified by:
        getCommentPrefixes in interface CsvMixin
        Returns:
        return The prefixes used to identify CSV lines to be ignored.
      • clearCommentPrefixes

        public void clearCommentPrefixes()
        Clears the prefixes used to identify CSV lines to be ignored. No CSV lines will be ignored any more.
        Specified by:
        clearCommentPrefixes in interface CsvMixin
      • withTrim

        public CsvBuilder withTrim​(boolean isTrim)
        Specified by:
        withTrim in interface org.refcodes.mixin.TrimAccessor.TrimBuilder<CsvMixin>
      • withDelimiter

        public CsvBuilder withDelimiter​(char aDelimiterChar)
        Specified by:
        withDelimiter in interface org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<CsvMixin>
      • withCommentPrefixes

        public CsvBuilder withCommentPrefixes​(String... aCommentPrefixes)
        Sets the prefixes used to identify CSV lines to be ignored.
        Specified by:
        withCommentPrefixes in interface CsvMixin
        Parameters:
        aCommentPrefixes - The prefixes used to identify CSV lines to be ignored.
        Returns:
        The instance on which this method has been invoked as of the builder pattern.
      • withRecord

        public CsvBuilder withRecord​(String aRecord)
        Sets the CSV line for the CSV line property.
        Parameters:
        aRecord - The CSV line to be stored by the CSV line property.
        Returns:
        The builder for applying multiple build operations.
      • setFields

        public void setFields​(boolean... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(byte... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(short... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(int... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(long... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(float... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(double... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(char... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • withFields

        public CsvBuilder withFields​(boolean... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(byte... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(short... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(int... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(long... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(float... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(double... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(char... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • setFields

        public void setFields​(Boolean... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Byte... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Short... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Integer... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Long... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Float... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Double... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(Character... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • setFields

        public void setFields​(String... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
      • withFields

        public CsvBuilder withFields​(Object... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Boolean... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Byte... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Short... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Integer... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Long... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Float... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Double... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Character... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(String... aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • withFields

        public CsvBuilder withFields​(Collection<Object> aFields)
        Sets the CSV elements for the CSV elements property.
        Parameters:
        aFields - The CSV elements to be stored by the CSV elements property.
        Returns:
        The builder for applying multiple build operations.
      • toRecord

        public String toRecord​(boolean... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(byte... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(short... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(int... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(long... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(float... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(double... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(char... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toString

        public String toString​(Object... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Boolean... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Byte... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Short... aFields)
        To record.
        Parameters:
        aFields - the fields
        Returns:
        the string
      • toRecord

        public String toRecord​(Integer... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Long... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Float... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Double... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toRecord

        public String toRecord​(Character... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toString

        public String toString​(String... aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toString

        public String toString​(Collection<Object> aFields)
        Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination of withFields(String...) with toRecord().
        Parameters:
        aFields - The CSV elements to be converted into a record.
        Returns:
        The CSV line created from the fields.
      • toFields

        public String[] toFields​(String aRecord)
        Creates an array of Strings from the CSV line being set via setRecord(String) or withRecord(String). It should return the same result as an array as a call to toFields(). Returns null if the record is a comment as of CsvMixin.isComment(String). This method is to be side effect free in terms of the record (and the resulting fields) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter via withDelimiter(char) can cause side effects! For avoiding thread race conditions / side effects regarding the record (and the resulting fields), use this method instead of the combination of withRecord(String) with toStrings().
        Parameters:
        aRecord - The CSV line to be stored by the CSV line property.
        Returns:
        The elements created from the CSV line or null if the record is a comment.
      • asFields

        public static List<String> asFields​(String aRecord,
                                            char aDelimiter,
                                            CsvEscapeMode aCsvEscapeMode,
                                            boolean isTrim)
        Creates fields from the given record.
        Parameters:
        aRecord - The record to use.
        aDelimiter - The delimiter to use.
        aCsvEscapeMode - The CsvEscapeMode to use.
        isTrim - True in case the record and the resulting fields are to be trimmed.
        Returns:
        The according record.
      • asRecord

        public static String asRecord​(Collection<Object> aFields,
                                      char aDelimiter,
                                      CsvEscapeMode aCsvEscapeMode)
        Creates a record from the given fields.
        Parameters:
        aFields - The fields to use.
        aDelimiter - The delimiter to use.
        aCsvEscapeMode - The CsvEscapeMode to use.
        Returns:
        The according record.
      • asStrings

        public static String[] asStrings​(String aRecord,
                                         char aDelimiterChar,
                                         CsvEscapeMode aCsvEscapeMode,
                                         boolean isTrim,
                                         String[] aCommentPrefixes)
        Splits a record into dedicated fields.
        Parameters:
        aRecord - The record which to split into dedicated fields.
        aDelimiterChar - The delimiter denoting the end of a value.
        aCsvEscapeMode - The CsvEscapeMode to use.
        isTrim - Whether to trim the record and the resulting fields.
        aCommentPrefixes - The prefixes used to identify comments.
        Returns:
        The according fields from the record.