public enum Format extends Enum<Format>
The toString
method provides the String you need.
Enum Constant and Description |
---|
BLACK
Black.
|
BLUE
Blue.
|
BOLD
It’s a BOLD strategy Cotton.
|
BROWN
Brown.
|
CYAN
Cyan.
|
DARK_BLUE
Dark blue.
|
DARK_GRAY
Dark gray.
|
DARK_GREEN
Dark green.
|
GREEN
Green.
|
ITALIC
Italic.
|
LIGHT_GRAY
Light gray.
|
MAGENTA
Magenta.
|
OLIVE
Olive.
|
PURPLE
Purple.
|
RED
Red.
|
RESET
Reset formatting.
|
REVERSE
esreveR.
|
TEAL
Teal.
|
UNDERLINE
Underline.
|
WHITE
White.
|
YELLOW
Yello.
|
Modifier and Type | Field and Description |
---|---|
static char |
COLOR_CHAR
Character indicating color.
|
Modifier and Type | Method and Description |
---|---|
int |
getColorChar()
Gets the int value for the color, if this is a color.
|
boolean |
isColor()
Gets if the format is a color.
|
static @NonNull String |
stripAll(@NonNull String input)
Strips color and formatting from a given input.
|
static @NonNull String |
stripColor(@NonNull String input)
Strips color from a given input.
|
static @NonNull String |
stripFormatting(@NonNull String input)
Strips formatting from a given input.
|
@NonNull String |
toString() |
static Format |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Format[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@NonNull String |
withBackground(@NonNull Format background)
Gets a String for displaying this color with a given background color.
|
public static final Format BLACK
public static final Format BLUE
public static final Format BOLD
public static final Format BROWN
public static final Format CYAN
public static final Format DARK_BLUE
public static final Format DARK_GRAY
public static final Format DARK_GREEN
public static final Format GREEN
public static final Format ITALIC
public static final Format LIGHT_GRAY
public static final Format MAGENTA
public static final Format RESET
public static final Format OLIVE
public static final Format PURPLE
public static final Format RED
public static final Format REVERSE
public static final Format TEAL
public static final Format UNDERLINE
public static final Format WHITE
public static final Format YELLOW
public static final char COLOR_CHAR
public static Format[] values()
for (Format c : Format.values()) System.out.println(c);
public static Format valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static @NonNull String stripAll(@NonNull String input)
input
- input to stripstripColor(String)
,
stripFormatting(String)
public static @NonNull String stripColor(@NonNull String input)
input
- input to strippublic static @NonNull String stripFormatting(@NonNull String input)
input
- input to strippublic boolean isColor()
public int getColorChar()
isColor()
public @NonNull String withBackground(@NonNull Format background)
background
- background colorIllegalArgumentException
- if using or providing a non-colorCopyright © 2013–2021 Kitteh. All rights reserved.