Class FixedColumnLengthTableMaker

java.lang.Object
org.apache.pulsar.testclient.utils.FixedColumnLengthTableMaker

public class FixedColumnLengthTableMaker extends Object
Light-weight utility for creating rows where each column has a fixed length in a command-line setting.
  • Field Details

    • bottomBorder

      public char bottomBorder
      Character to duplicate to make the bottom border.
    • decimalFormatter

      public String decimalFormatter
      Format String to apply to decimal entries. If set to null, no special formatting is applied.
    • elementLength

      public int elementLength
      Length of table elements. Elements whose String representations exceed this length are trimmed down to this length.
    • leftBorder

      public String leftBorder
      The border to use to make the left side of the table.
    • leftPadding

      public int leftPadding
      The amount of spacing to pad left of an element with.
    • rightBorder

      public String rightBorder
      The border to use to make the right side of the table.
    • rightPadding

      public int rightPadding
      The amount of spacing to pad right of an element with.
    • separator

      public String separator
      The String to separate elements with.
    • topBorder

      public char topBorder
      Character to duplicate to make the top border.
    • lengthFunction

      public Function<Integer,Integer> lengthFunction
      If not null, lengthFunction should give the length for the given column index.
  • Constructor Details

    • FixedColumnLengthTableMaker

      public FixedColumnLengthTableMaker()
  • Method Details

    • make

      public String make(Object[][] rows)
      Make a table using the specified settings.
      Parameters:
      rows - Rows to construct the table from.
      Returns:
      A String version of the table.