Enum Class SimpleHorizontalAligner

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

public enum SimpleHorizontalAligner extends Enum<SimpleHorizontalAligner> implements Aligner
An horizontal alignment strategy that allows alignment to the left, center or right.
  • Enum Constant Details

  • Method Details

    • values

      public static SimpleHorizontalAligner[] 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 SimpleHorizontalAligner 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