Package fr.diskmth.loggy
Class ANSI
java.lang.Object
fr.diskmth.loggy.ANSI
The ANSI class provides a set of static constants and methods to format console output using ANSI escape codes.
- Since:
- Loggy 1.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIprotected final Stringstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSIstatic final ANSI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringclearFormat(String message) Removes ANSI formatting codes from a string.static StringFormats a string with the specified ANSI codes.getCode()Returns the ANSI code associated with the instance.static ANSIConcatenates multiple ANSI codes into a single ANSI instance.
-
Field Details
-
RESET
-
BOLD
-
ITALIC
-
UNDERLINE
-
REVERSE
-
STRIKETHROUGH
-
BLACK
-
RED
-
GREEN
-
YELLOW
-
BLUE
-
MAGENTA
-
CYAN
-
WHITE
-
BLACK_BRIGHT
-
RED_BRIGHT
-
GREEN_BRIGHT
-
YELLOW_BRIGHT
-
BLUE_BRIGHT
-
MAGENTA_BRIGHT
-
CYAN_BRIGHT
-
WHITE_BRIGHT
-
BLACK_BG
-
RED_BG
-
GREEN_BG
-
YELLOW_BG
-
BLUE_BG
-
MAGENTA_BG
-
CYAN_BG
-
WHITE_BG
-
BLACK_BRIGHT_BG
-
RED_BRIGHT_BG
-
GREEN_BRIGHT_BG
-
YELLOW_BRIGHT_BG
-
BLUE_BRIGHT_BG
-
MAGENTA_BRIGHT_BG
-
CYAN_BRIGHT_BG
-
WHITE_BRIGHT_BG
-
code
-
-
Constructor Details
-
ANSI
Creates an instance of ANSI with the specified code.- Parameters:
code- the ANSI code to associate with the instance
-
-
Method Details
-
multiple
Concatenates multiple ANSI codes into a single ANSI instance.- Parameters:
formats- the different ANSI codes to concatenate- Returns:
- an instance of ANSI with all the codes passed in parameters concatenated
-
format
Formats a string with the specified ANSI codes.- Parameters:
message- the string to formatformats- the ANSI codes to apply to the string- Returns:
- the formatted string
-
clearFormat
Removes ANSI formatting codes from a string.- Parameters:
message- the string to remove the formatting from- Returns:
- the string without any ANSI formatting codes
-
getCode
Returns the ANSI code associated with the instance.- Returns:
- the ANSI code
-