Package dk.lockfuglsang.minecraft.util
Enum Class FormatUtil
- All Implemented Interfaces:
Serializable
,Comparable<FormatUtil>
,Constable
Format utility
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
Escapes formatting by "denormalizing" back to using & instead of §.static String
static String
static String
stripFormatting(String format)
static FormatUtil
Returns the enum constant of this class with the specified name.static FormatUtil[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Wraps the string rather lazyly around the linesize (over).wordWrapStrict(String s, int lineLength)
Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
stripFormatting
-
normalize
-
wordWrap
-
wordWrap
Wraps the string rather lazyly around the linesize (over). I.e.this is a line of words
Will break into the following with linesize of 11:this is a line of words
Note that the first line is longer than 11 (14). -
wordWrapStrict
-
join
-
prefix
-
camelcase
-
escape
Escapes formatting by "denormalizing" back to using & instead of §.- Parameters:
formatString
- A formatstring (formerly normalized).- Returns:
- A non-format string using & instead of §.
- Since:
- 1.10
-