Class TextTable


  • public class TextTable
    extends java.lang.Object
    Utility to format data into a textual (markdown-compliant) table.
    • Constructor Detail

    • Method Detail

      • build

        public java.lang.String build​(java.lang.String lineEnding)
      • append

        public void append​(java.lang.StringBuilder destination,
                           java.lang.String lineEnding)
        Appends the data formatted as a table to the given string builder. The padding character used for the column alignments is a single space (' '), the separate between column headers and values is a dash ('-'). Note that you *have* to specify a line ending, '\n' isn't used by default.

        The generated table is compliant with the markdown file format.

        Parameters:
        destination - a string builder to append the table to
        lineEnding - the line ending to use for each row of the table
      • printSeparators

        private void printSeparators​(java.lang.StringBuilder destination)
      • printRow

        private void printRow​(java.lang.StringBuilder destination,
                              java.util.List<java.lang.String> values)
      • add

        public void add​(@Nonnull
                        java.lang.Object... values)
      • clear

        public void clear()