Class TableOutput


  • public class TableOutput
    extends Object
    • Constructor Detail

      • TableOutput

        public TableOutput()
    • Method Detail

      • formatUnwrappedOutput

        public static void formatUnwrappedOutput​(List<List<String>> table,
                                                 boolean leftJustifiedRows,
                                                 Writer writer)
                                          throws LiquibaseException
        This method outputs the input data in a tabular format *without* wrapping of lines
        Parameters:
        table - 2-dimensional array of data
        leftJustifiedRows - If true then add "-" to format string
        writer - Writer to use for output
        Throws:
        LiquibaseException
      • formatOutput

        public static void formatOutput​(List<List<String>> table,
                                        List<Integer> maxWidths,
                                        boolean leftJustifiedRows,
                                        Writer writer)
                                 throws LiquibaseException
        This method outputs the input data in a tabular format with wrapping of lines
        Parameters:
        table - 2-dimensional array of data
        maxWidths - Maximum widths of each column to control wrapping
        leftJustifiedRows - If true then add "-" to format string
        writer - Writer to use for output
        Throws:
        LiquibaseException
      • formatOutput

        public static void formatOutput​(List<List<String>> table,
                                        int[] maxWidths,
                                        boolean leftJustifiedRows,
                                        Writer writer)
                                 throws LiquibaseException
        This method outputs the input data in a tabular format with wrapping of lines
        Parameters:
        table - 2-dimensional array of data
        maxWidths - Maximum widths of each column to control wrapping
        leftJustifiedRows - If true then add "-" to format string
        writer - Writer to use for output
        Throws:
        LiquibaseException
      • formatOutput

        public static void formatOutput​(String[][] table,
                                        int[] maxWidths,
                                        boolean leftJustifiedRows,
                                        Writer writer)
                                 throws LiquibaseException
        This method outputs the input data in a tabular format with wrapping of lines
        Parameters:
        table - 2-dimensional array of data
        maxWidths - Maximum widths of each column to control wrapping
        leftJustifiedRows - If true then add "-" to format string
        writer - Writer to use for output
        Throws:
        LiquibaseException
      • formatOutput

        public static void formatOutput​(String[][] table,
                                        List<Integer> maxWidths,
                                        boolean leftJustifiedRows,
                                        Writer writer)
                                 throws LiquibaseException
        This method outputs the input data in a tabular format with wrapping of lines
        Parameters:
        table - 2-dimensional array of data
        maxWidths - Maximum widths of each column to control wrapping
        leftJustifiedRows - If true then add "-" to format string
        writer - Writer to use for output
        Throws:
        LiquibaseException
      • computeMaxWidths

        public static List<Integer> computeMaxWidths​(List<List<String>> rows)
        Compute the size of the largest string of each column of the provided table
        Parameters:
        rows - the provided table to compute widths from
        Returns:
        an empty immutable list if the provided table is empty
        Throws:
        RuntimeException - if rows is null or the column count is not the same for every row
      • computeMaxWidths

        public static List<Integer> computeMaxWidths​(String[][] rows)
        Compute the size of the largest string of each column of the provided table
        Parameters:
        rows - the provided table to compute widths from
        Returns:
        an empty immutable list if the provided table is empty
        Throws:
        RuntimeException - if rows is null or the column count is not the same for every row