Enum Class Colors

java.lang.Object
java.lang.Enum<Colors>
software.amazon.smithy.cli.Colors
All Implemented Interfaces:
Serializable, Comparable<Colors>, Constable

public enum Colors extends Enum<Colors>
Provides an abstraction for printing with ANSI colors if it is supported.
  • Enum Constant Details

    • BLACK

      public static final Colors BLACK
    • RED

      public static final Colors RED
    • BOLD_RED

      public static final Colors BOLD_RED
    • GREEN

      public static final Colors GREEN
    • BOLD_GREEN

      public static final Colors BOLD_GREEN
    • YELLOW

      public static final Colors YELLOW
    • BLUE

      public static final Colors BLUE
    • MAGENTA

      public static final Colors MAGENTA
    • CYAN

      public static final Colors CYAN
    • WHITE

      public static final Colors WHITE
    • BRIGHT_BLACK

      public static final Colors BRIGHT_BLACK
    • BRIGHT_RED

      public static final Colors BRIGHT_RED
    • BRIGHT_BOLD_RED

      public static final Colors BRIGHT_BOLD_RED
    • BRIGHT_GREEN

      public static final Colors BRIGHT_GREEN
    • BRIGHT_BOLD_GREEN

      public static final Colors BRIGHT_BOLD_GREEN
    • BRIGHT_YELLOW

      public static final Colors BRIGHT_YELLOW
    • BRIGHT_BOLD_YELLOW

      public static final Colors BRIGHT_BOLD_YELLOW
    • BRIGHT_BLUE

      public static final Colors BRIGHT_BLUE
    • BRIGHT_MAGENTA

      public static final Colors BRIGHT_MAGENTA
    • BRIGHT_CYAN

      public static final Colors BRIGHT_CYAN
    • BRIGHT_WHITE

      public static final Colors BRIGHT_WHITE
  • Method Details

    • values

      public static Colors[] 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 Colors 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
    • out

      public void out(String message)
      Prints to stdout using the Color if ANSI colors are enabled.
      Parameters:
      message - Message to print.
    • err

      public void err(String message)
      Prints to stderr using the Color if ANSI colors are enabled.
      Parameters:
      message - Message to print.
    • write

      public void write(Consumer<String> consumer, String message)
      Writes the color output to the given consumer.
      Parameters:
      consumer - Consume to invoke.
      message - Message to write.