Enum TableStyle

java.lang.Object
java.lang.Enum<TableStyle>
org.refcodes.textual.TableStyle
All Implemented Interfaces:
Serializable, Comparable<TableStyle>, java.lang.constant.Constable

public enum TableStyle
extends Enum<TableStyle>
The Enum TableStyle defines character sets for various box border styles.
  • Enum Constant Details

  • Field Details

    • UNICODE_TABLE_STYLE

      public static final TableStyle UNICODE_TABLE_STYLE
      Style supported Unicode capable terminals (when not being under test).
    • WINDOWS_TABLE_STYLE

      public static final TableStyle WINDOWS_TABLE_STYLE
      Style displayed for sure when being on a Windows machine.
    • OTHER_TABLE_STYLE

      public static final TableStyle OTHER_TABLE_STYLE
      Style displayed for sure when being under test (e.g. JUnit) or in a Cp1252 or a plain "xterm".
  • Method Details

    • values

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

      public static TableStyle valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getHeader

      public TextBoxGrid getHeader()
      Returns the table header's characters.
      Returns:
      The table header characters.
    • getBody

      public TextBoxGrid getBody()
      Returns the table body's characters.
      Returns:
      The table body characters.
    • getTail

      public TextBoxGrid getTail()
      Returns the table tail's characters.
      Returns:
      The table header characters.
    • toTableStyle

      public static TableStyle toTableStyle​(String aValue)
      Retrieves a TableStyle depending on the given string, ignoring the case as well as beeing graceful regarding "-" and "_",
      Parameters:
      aValue - The name of the TableStyle to be interpreted graceful.
      Returns:
      The TableStyle being determined.
    • toRuntimeTableStyle

      public static TableStyle toRuntimeTableStyle()
      Depending on the runtime environment (Windows, Linux, JUnit) we prefer different table styles as depending on the runtime environment not all characters used by the various table styles may be available.
      Returns:
      The TableStyle by default fitting best for the current environment.