Package software.amazon.smithy.cli
Enum AnsiColorFormatter
- java.lang.Object
- 
- java.lang.Enum<AnsiColorFormatter>
- 
- software.amazon.smithy.cli.AnsiColorFormatter
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<AnsiColorFormatter>,- ColorFormatter
 
 public enum AnsiColorFormatter extends java.lang.Enum<AnsiColorFormatter> implements ColorFormatter Styles text using ANSI color codes.
- 
- 
Enum Constant SummaryEnum Constants Enum Constant Description AUTOWrites using ANSI colors if it detects that the environment supports color.FORCE_COLORWrites with ANSI colors.NO_COLORDoes not write any color.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static AnsiColorFormatterdetect()Detects if ANSI colors are supported and returns the appropriate Ansi enum variant.static AnsiColorFormattervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AnsiColorFormatter[]values()Returns an array containing the constants of this enum type, in the order they are declared.- 
Methods inherited from class java.lang.Enumclone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 - 
Methods inherited from interface software.amazon.smithy.cli.ColorFormatterendStyle, isColorEnabled, println, startStyle, style, style
 
- 
 
- 
- 
- 
Enum Constant Detail- 
NO_COLORpublic static final AnsiColorFormatter NO_COLOR Does not write any color.
 - 
FORCE_COLORpublic static final AnsiColorFormatter FORCE_COLOR Writes with ANSI colors.
 - 
AUTOpublic static final AnsiColorFormatter AUTO Writes using ANSI colors if it detects that the environment supports color.
 
- 
 - 
Method Detail- 
valuespublic static AnsiColorFormatter[] 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 (AnsiColorFormatter c : AnsiColorFormatter.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static AnsiColorFormatter 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 name
- java.lang.NullPointerException- if the argument is null
 
 - 
detectpublic static AnsiColorFormatter detect() Detects if ANSI colors are supported and returns the appropriate Ansi enum variant.This method differs from using the AUTOvariant directly because it will detect any changes to the environment that might enable or disable colors.- Returns:
- Returns the detected ANSI color enum variant.
 
 
- 
 
-