Class TextFormatting.TableBuilder

java.lang.Object
de.chojo.jdautil.text.TextFormatting.TableBuilder
Enclosing class:
TextFormatting

public static class TextFormatting.TableBuilder extends Object
  • Method Details

    • setNextRow

      public void setNextRow(String... columnEntries)
      Moves the row pointer one step forward an set the row content.
      Parameters:
      columnEntries - Entries for the columns in the current row
    • setRow

      public void setRow(String... columnEntries)
      Set the current row. To go a row forward user next().
      Parameters:
      columnEntries - Entries for the columns in the current row
    • next

      public void next()
      The pointer starts at 0. Row zero can only be set on object creation. use next() before you set the first row.
    • setHighlighting

      public TextFormatting.TableBuilder setHighlighting(@NotNull @NotNull String markdown)
      Set the markdown for the table code block.
      Parameters:
      markdown - Markdown code (i.e. java, md, csharp)
      Returns:
      self instance with highlighting set
    • setPadding

      public TextFormatting.TableBuilder setPadding(int padding)
      Set the space between the columns.
      Parameters:
      padding - number between 1 and 10
      Returns:
      self instance with padding set
    • toString

      public String toString()
      Returns the formatted table in block code style.
      Overrides:
      toString in class Object
      Returns:
      Table as string.