Package software.amazon.smithy.cli
Enum Colors
- java.lang.Object
-
- java.lang.Enum<Colors>
-
- software.amazon.smithy.cli.Colors
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLACK
BLUE
BOLD_GREEN
BOLD_RED
BRIGHT_BLACK
BRIGHT_BLUE
BRIGHT_BOLD_GREEN
BRIGHT_BOLD_RED
BRIGHT_BOLD_YELLOW
BRIGHT_CYAN
BRIGHT_GREEN
BRIGHT_MAGENTA
BRIGHT_RED
BRIGHT_WHITE
BRIGHT_YELLOW
CYAN
GREEN
MAGENTA
RED
WHITE
YELLOW
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
err(java.lang.String message)
Prints to stderr using the Color if ANSI colors are enabled.void
out(java.lang.String message)
Prints to stdout using the Color if ANSI colors are enabled.static Colors
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Colors[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.void
write(java.util.function.Consumer<java.lang.String> consumer, java.lang.String message)
Writes the color output to the given consumer.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static Colors[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Colors c : Colors.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Colors valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
out
public void out(java.lang.String message)
Prints to stdout using the Color if ANSI colors are enabled.- Parameters:
message
- Message to print.
-
err
public void err(java.lang.String message)
Prints to stderr using the Color if ANSI colors are enabled.- Parameters:
message
- Message to print.
-
write
public void write(java.util.function.Consumer<java.lang.String> consumer, java.lang.String message)
Writes the color output to the given consumer.- Parameters:
consumer
- Consume to invoke.message
- Message to write.
-
-