Class CSVFormatter

    • Constructor Detail

      • CSVFormatter

        public CSVFormatter​(CSV csvFormat)
        Instantiates a new CSV formatter.
        Parameters:
        csvFormat - the csv format
    • Method Detail

      • format

        public String format​(Stream<?> stream)
        Formats the items in the given Stream.
        Parameters:
        stream - the stream
        Returns:
        the string
      • format

        public String format​(Iterator<?> itr)
        Formats the items in an Iterator.
        Parameters:
        itr - The iterator to format
        Returns:
        A String representing the single DSV formatted row
      • format

        public String format​(Map<?,​?> map)
        Formats the items in a Map. Keys and values are separated using :.
        Parameters:
        map - The Map to format
        Returns:
        A String representing the single DSV formatted row of Map entries
      • format

        public String format​(Map<?,​?> map,
                             char keyValueSeparator)
        Formats the items in a Map.
        Parameters:
        map - The Map to format
        keyValueSeparator - the character to use to separate keys and values
        Returns:
        A String representing the single DSV formatted row of Map entries
      • format

        public String format​(Iterable<?> iterable)
        Formats the items in an Iterable.
        Parameters:
        iterable - the iterable
        Returns:
        the string
      • format

        public String format​(Object... array)
        Formats the items in an Array.
        Parameters:
        array - The array to format
        Returns:
        A String representing the single DSV formatted row