java.lang.Object
java.lang.Enum<TerminalEncoding>
com.github.cowwoc.requirements10.java.TerminalEncoding
All Implemented Interfaces:
Serializable, Comparable<TerminalEncoding>, Constable

public enum TerminalEncoding extends Enum<TerminalEncoding>
The ANSI escape codes supported by the terminal.
  • Enum Constant Details

    • NONE

      public static final TerminalEncoding NONE
      The terminal does not support any colors.
    • XTERM_8_COLORS

      public static final TerminalEncoding XTERM_8_COLORS
      The terminal supports 8 colors.
    • XTERM_16_COLORS

      public static final TerminalEncoding XTERM_16_COLORS
      The terminal supports 16 colors.
    • XTERM_256_COLORS

      public static final TerminalEncoding XTERM_256_COLORS
      The terminal supports 256 colors.
    • RGB_888_COLORS

      public static final TerminalEncoding RGB_888_COLORS
      The terminal supports 16 million colors.
  • Method Details

    • values

      public static TerminalEncoding[] 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 TerminalEncoding 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
    • sortByDecreasingRank

      public static Comparator<TerminalEncoding> sortByDecreasingRank()
      Returns a comparator that sorts encodings based on the number of colors that they support, from the most to the least number of colors.
      Returns:
      a negative number if first supports more colors than second, 0 if they support the same number of colors, and a positive number if second supports more colors than first