public enum TextFormat extends Enum<TextFormat>
| Enum Constant and Description |
|---|
AQUA
Represents aqua.
|
BLACK
Represents black.
|
BLUE
Represents blue.
|
BOLD
Makes the text bold.
|
DARK_AQUA
Represents dark blue (aqua).
|
DARK_BLUE
Represents dark blue.
|
DARK_GRAY
Represents dark gray.
|
DARK_GREEN
Represents dark green.
|
DARK_PURPLE
Represents dark purple.
|
DARK_RED
Represents dark red.
|
GOLD
Represents gold.
|
GRAY
Represents gray.
|
GREEN
Represents green.
|
ITALIC
Makes the text italic.
|
LIGHT_PURPLE
Represents light purple.
|
OBFUSCATED
Makes the text obfuscated.
|
ORANGE
Represents orange.
|
RED
Represents red.
|
RESET
Resets all previous chat colors or formats.
|
STRIKETHROUGH
Makes a line appear through the text.
|
UNDERLINE
Makes the text appear underlined.
|
WHITE
Represents white.
|
YELLOW
Represents yellow.
|
| Modifier and Type | Field and Description |
|---|---|
static char |
ESCAPE
The special character which prefixes all format codes.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
clean(String input)
Cleans the given message of all format codes.
|
static String |
clean(String input,
boolean recursive) |
static String |
colorize(char altFormatChar,
String textToTranslate)
Translates a string using an alternate format code character into a
string that uses the internal TextFormat.ESCAPE format code
character.
|
static String |
colorize(String textToTranslate)
Translates a string, using an ampersand (&) as an alternate format code
character, into a string that uses the internal TextFormat.ESCAPE format
code character.
|
static TextFormat |
getByChar(char code)
Gets the TextFormat represented by the specified format code.
|
static TextFormat |
getByChar(String code)
Gets the TextFormat represented by the specified format code.
|
char |
getChar()
Gets the char value associated with this color
|
static String |
getLastColors(String input)
Gets the chat color used at the end of the given input string.
|
boolean |
isColor()
Checks if this code is a color code as opposed to a format code.
|
boolean |
isFormat()
Checks if this code is a format code as opposed to a color code.
|
String |
toString() |
static TextFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TextFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TextFormat BLACK
public static final TextFormat DARK_BLUE
public static final TextFormat DARK_GREEN
public static final TextFormat DARK_AQUA
public static final TextFormat DARK_RED
public static final TextFormat DARK_PURPLE
public static final TextFormat ORANGE
public static final TextFormat GRAY
public static final TextFormat DARK_GRAY
public static final TextFormat BLUE
public static final TextFormat GREEN
public static final TextFormat AQUA
public static final TextFormat RED
public static final TextFormat LIGHT_PURPLE
public static final TextFormat YELLOW
public static final TextFormat WHITE
public static final TextFormat GOLD
public static final TextFormat OBFUSCATED
public static final TextFormat BOLD
public static final TextFormat STRIKETHROUGH
public static final TextFormat UNDERLINE
public static final TextFormat ITALIC
public static final TextFormat RESET
public static final char ESCAPE
public static TextFormat[] values()
for (TextFormat c : TextFormat.values()) System.out.println(c);
public static TextFormat 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 TextFormat getByChar(char code)
code - Code to checkTextFormat with the given code,
or null if it doesn't existpublic static TextFormat getByChar(String code)
code - Code to checkTextFormat with the given code,
or null if it doesn't existpublic static String clean(String input)
input - String to clean.public static String colorize(char altFormatChar, String textToTranslate)
altFormatChar - The alternate format code character to replace. Ex: &textToTranslate - Text containing the alternate format code character.public static String colorize(String textToTranslate)
textToTranslate - Text containing the alternate format code character.public static String getLastColors(String input)
input - Input string to retrieve the colors from.public char getChar()
public String toString()
toString in class Enum<TextFormat>public boolean isFormat()
public boolean isColor()
Copyright © 2020. All rights reserved.