Class AutoSizeConstraints

java.lang.Object
org.springframework.shell.table.AutoSizeConstraints
All Implemented Interfaces:
SizeConstraints

public class AutoSizeConstraints extends Object implements SizeConstraints
A SizeConstraints implementation that splits lines at space boundaries and returns an extent with minimal and maximal width requirements.
  • Constructor Details

    • AutoSizeConstraints

      public AutoSizeConstraints()
  • Method Details

    • width

      public SizeConstraints.Extent width(String[] raw, int tableWidth, int nbColumns)
      Specified by:
      width in interface SizeConstraints
      Parameters:
      raw - the raw String representation of the cell contents (may be reformatted later, eg wrapped)
      tableWidth - the whole available width for the table
      nbColumns - the number of columns in the table
      Returns:
      the minimum and maximum width of the cell, given its raw content.