Class TableBuilder

java.lang.Object
org.springframework.shell.table.TableBuilder

public class TableBuilder extends Object
A builder class to incrementally configure a Table.
  • Constructor Details

    • TableBuilder

      public TableBuilder(TableModel model)
      Construct a table with the given model. The table will use the following strategies for all cells, unless overridden:
      Parameters:
      model - the data model of the table to construct
  • Method Details

    • getModel

      public TableModel getModel()
    • on

    • build

      public Table build()
    • paintBorder

      public TableBuilder.BorderStub paintBorder(BorderStyle style, int match)
    • addOutlineBorder

      public TableBuilder addOutlineBorder(BorderStyle style)
      Set a border on the outline of the whole table.
      Parameters:
      style - the style to apply
      Returns:
      this, for method chaining
    • addHeaderBorder

      public TableBuilder addHeaderBorder(BorderStyle style)
      Set a border on the outline of the whole table, as well as around the first row.
      Parameters:
      style - the style to apply
      Returns:
      this, for method chaining
    • addFullBorder

      public TableBuilder addFullBorder(BorderStyle style)
      Set a border around each and every cell of the table.
      Parameters:
      style - the style to apply
      Returns:
      this, for method chaining
    • addHeaderAndVerticalsBorders

      public TableBuilder addHeaderAndVerticalsBorders(BorderStyle style)
      Set a border on the outline of the whole table, around the first row and draw vertical lines around each column.
      Parameters:
      style - the style to apply
      Returns:
      this, for method chaining
    • addInnerBorder

      public TableBuilder addInnerBorder(BorderStyle style)
      Set a border on the inner verticals and horizontals of the table, but not on the outline.
      Parameters:
      style - the style to apply
      Returns:
      this, for method chaining