Package net.minecraft.util
Enum Formatting
- All Implemented Interfaces:
Serializable,Comparable<Formatting>,java.lang.constant.Constable
public enum Formatting extends Enum<Formatting>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants Enum Constant Description AQUABLACKBLUEBOLDDARK_AQUADARK_BLUEDARK_GRAYDARK_GREENDARK_PURPLEDARK_REDGOLDGRAYGREENITALICLIGHT_PURPLEOBFUSCATEDREDRESETSTRIKETHROUGHUNDERLINEWHITEYELLOW -
Field Summary
Fields Modifier and Type Field Description private static Map<String,Formatting>BY_NAMEprivate charcodeprivate intcolorIndexprivate IntegercolorValueprivate static PatternFORMATTING_CODE_PATTERNprivate booleanmodifierprivate Stringnameprivate StringstringValue -
Constructor Summary
Constructors Modifier Constructor Description privateFormatting(String name, char code, boolean modifier)privateFormatting(String name, char code, boolean modifier, int colorIndex, Integer colorValue)privateFormatting(String name, char code, int colorIndex, Integer colorValue) -
Method Summary
Modifier and Type Method Description static FormattingbyCode(char code)static FormattingbyColorIndex(int colorIndex)static FormattingbyName(String name)intgetColorIndex()IntegergetColorValue()StringgetName()static Collection<String>getNames(boolean colors, boolean modifiers)booleanisColor()booleanisModifier()private static Stringsanitize(String name)static Stringstrip(String string)StringtoString()static FormattingvalueOf(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.
-
Enum Constant Details
-
BLACK
-
DARK_BLUE
-
DARK_GREEN
-
DARK_AQUA
-
DARK_RED
-
DARK_PURPLE
-
GOLD
-
GRAY
-
DARK_GRAY
-
BLUE
-
GREEN
-
AQUA
-
RED
-
LIGHT_PURPLE
-
YELLOW
-
WHITE
-
OBFUSCATED
-
BOLD
-
STRIKETHROUGH
-
UNDERLINE
-
ITALIC
-
RESET
-
-
Field Details
-
BY_NAME
-
FORMATTING_CODE_PATTERN
-
name
-
code
private final char code -
modifier
private final boolean modifier -
stringValue
-
colorIndex
private final int colorIndex -
colorValue
-
-
Constructor Details
-
Formatting
-
Formatting
-
Formatting
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
sanitize
-
getColorIndex
public int getColorIndex() -
isModifier
public boolean isModifier() -
isColor
public boolean isColor() -
getColorValue
-
getName
-
toString
- Overrides:
toStringin classEnum<Formatting>
-
strip
-
byName
-
byColorIndex
-
byCode
-
getNames
-