public enum Formatting extends Enum<Formatting>
Enum Constant and Description |
---|
AQUA |
BLACK |
BLUE |
BOLD |
DARK_AQUA |
DARK_BLUE |
DARK_GRAY |
DARK_GREEN |
DARK_PURPLE |
DARK_RED |
GOLD |
GRAY |
GREEN |
ITALIC |
LIGHT_PURPLE |
OBFUSCATED |
RED |
RESET |
STRIKETHROUGH |
UNDERLINE |
WHITE |
YELLOW |
Modifier and Type | Field and Description |
---|---|
private static Map<String,Formatting> |
BY_NAME |
private char |
code |
private int |
colorIndex |
private Integer |
colorValue |
private static Pattern |
FORMATTING_CODE_PATTERN |
private boolean |
modifier |
private String |
name |
private String |
stringValue |
Modifier and Type | Method and Description |
---|---|
static Formatting |
byCode(char code) |
static Formatting |
byColorIndex(int colorIndex) |
static Formatting |
byName(String name) |
int |
getColorIndex() |
Integer |
getColorValue() |
String |
getName() |
static Collection<String> |
getNames(boolean colors,
boolean modifiers) |
boolean |
isColor() |
boolean |
isModifier() |
private static String |
sanitize(String name) |
static String |
strip(String string) |
String |
toString() |
static Formatting |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Formatting[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Formatting BLACK
public static final Formatting DARK_BLUE
public static final Formatting DARK_GREEN
public static final Formatting DARK_AQUA
public static final Formatting DARK_RED
public static final Formatting DARK_PURPLE
public static final Formatting GOLD
public static final Formatting GRAY
public static final Formatting DARK_GRAY
public static final Formatting BLUE
public static final Formatting GREEN
public static final Formatting AQUA
public static final Formatting RED
public static final Formatting LIGHT_PURPLE
public static final Formatting YELLOW
public static final Formatting WHITE
public static final Formatting OBFUSCATED
public static final Formatting BOLD
public static final Formatting STRIKETHROUGH
public static final Formatting UNDERLINE
public static final Formatting ITALIC
public static final Formatting RESET
private static final Map<String,Formatting> BY_NAME
private static final Pattern FORMATTING_CODE_PATTERN
private final String name
private final char code
private final boolean modifier
private final String stringValue
private final int colorIndex
public static Formatting[] values()
for (Formatting c : Formatting.values()) System.out.println(c);
public static Formatting 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 int getColorIndex()
public boolean isModifier()
public boolean isColor()
public String getName()
public String toString()
toString
in class Enum<Formatting>
@Nullable public static Formatting byName(@Nullable String name)
@Nullable public static Formatting byColorIndex(int colorIndex)
@Environment(value=CLIENT) @Nullable public static Formatting byCode(char code)
public static Collection<String> getNames(boolean colors, boolean modifiers)