java.lang.Object
net.neoforged.testframework.summary.md.Table

public final class Table extends Object
  • Field Details

    • SEPARATOR

      public static final String SEPARATOR
      See Also:
    • WHITESPACE

      public static final String WHITESPACE
      See Also:
    • DEFAULT_TRIMMING_INDICATOR

      public static final String DEFAULT_TRIMMING_INDICATOR
      See Also:
    • DEFAULT_MINIMUM_COLUMN_WIDTH

      public static final int DEFAULT_MINIMUM_COLUMN_WIDTH
      See Also:
    • rows

      private final List<TableRow<?>> rows
    • alignments

      private final List<Alignment> alignments
    • firstRowIsHeader

      private final boolean firstRowIsHeader
    • minimumColumnWidth

      private final int minimumColumnWidth
    • trimmingIndicator

      private final String trimmingIndicator
  • Constructor Details

  • Method Details

    • builder

      public static Table.Builder builder()
    • serialize

      public String serialize()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • trim

      public Table trim(int rowsToKeep)
      Removes rows from the center of the table until only the requested amount of rows is left.
      Parameters:
      rowsToKeep - the amount of rows that should be kept
      Returns:
      the trimmed table
    • copy

      public Table copy()
      Returns a copy of this table.
      Returns:
      a copy of this table
    • generateHeaderSeparator

      public static String generateHeaderSeparator(Map<Integer,Integer> columnWidths, List<Alignment> alignments)
    • getColumnWidths

      public static Map<Integer,Integer> getColumnWidths(List<TableRow<?>> rows, int minimumColumnWidth)
    • getMaximumItemLength

      public static int getMaximumItemLength(List<TableRow<?>> rows, int columnIndex, int minimumColumnWidth)
    • getAlignment

      public static Alignment getAlignment(List<Alignment> alignments, int columnIndex)
    • getRows

      public List<TableRow<?>> getRows()
    • surroundWith

      public static String surroundWith(String value, String surrounding)