Enum Class SimpleVerticalAligner

java.lang.Object
java.lang.Enum<SimpleVerticalAligner>
org.springframework.shell.table.SimpleVerticalAligner
All Implemented Interfaces:
Serializable, Comparable<SimpleVerticalAligner>, Constable, Aligner

public enum SimpleVerticalAligner extends Enum<SimpleVerticalAligner> implements Aligner
Alignment strategy that allows simple vertical alignment to top, middle or bottom.
  • Enum Constant Details

  • Method Details

    • values

      public static SimpleVerticalAligner[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SimpleVerticalAligner valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • align

      public String[] align(String[] text, int cellWidth, int cellHeight)
      Description copied from interface: Aligner
      Perform text alignment, returning a String array that MUST contain cellHeight lines, each of which MUST be cellWidth chars in length.

      Input array is guaranteed to contain lines that have length equal to cellWidth. There is no guarantee on the input number of lines though.

      Specified by:
      align in interface Aligner
      Parameters:
      text - the text to align
      cellWidth - the width of of the table cell
      cellHeight - the height of the table cell
      Returns:
      the aligned text, in a cellHeight element array