Package net.kyori.adventure.text.format
Enum TextDecoration
- java.lang.Object
-
- java.lang.Enum<TextDecoration>
-
- net.kyori.adventure.text.format.TextDecoration
-
- All Implemented Interfaces:
Serializable
,Comparable<TextDecoration>
,ComponentBuilderApplicable
,StyleBuilderApplicable
,TextFormat
public enum TextDecoration extends Enum<TextDecoration> implements StyleBuilderApplicable, TextFormat
An enumeration of decorations which may be applied to aComponent
.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextDecoration.State
A state that aTextDecoration
can be in.
-
Enum Constant Summary
Enum Constants Enum Constant Description BOLD
A decoration which makes text appear bold.ITALIC
A decoration which makes text appear in italics.OBFUSCATED
A decoration which makes text obfuscated/unreadable.STRIKETHROUGH
A decoration which makes text have a strike through it.UNDERLINED
A decoration which makes text have an underline.
-
Field Summary
Fields Modifier and Type Field Description static Index<String,TextDecoration>
NAMES
The name map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @NotNull TextDecorationAndState
as(boolean state)
Deprecated.for removal since 4.10.0, usewithState(boolean)
instead@NotNull TextDecorationAndState
as(@NotNull TextDecoration.State state)
Deprecated.for removal since 4.10.0, usewithState(State)
insteadvoid
styleApply(@NotNull Style.Builder style)
Applies tostyle
.@NotNull String
toString()
static TextDecoration
valueOf(String name)
Returns the enum constant of this type with the specified name.static TextDecoration[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.@NotNull TextDecorationAndState
withState(boolean state)
An alias foras(boolean)
.@NotNull TextDecorationAndState
withState(@NotNull TextDecoration.State state)
An alias foras(State)
.@NotNull TextDecorationAndState
withState(@NotNull TriState state)
An alias foras(State)
.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface net.kyori.adventure.text.format.StyleBuilderApplicable
componentBuilderApply
-
-
-
-
Enum Constant Detail
-
OBFUSCATED
public static final TextDecoration OBFUSCATED
A decoration which makes text obfuscated/unreadable.- Since:
- 4.0.0
-
BOLD
public static final TextDecoration BOLD
A decoration which makes text appear bold.- Since:
- 4.0.0
-
STRIKETHROUGH
public static final TextDecoration STRIKETHROUGH
A decoration which makes text have a strike through it.- Since:
- 4.0.0
-
UNDERLINED
public static final TextDecoration UNDERLINED
A decoration which makes text have an underline.- Since:
- 4.0.0
-
ITALIC
public static final TextDecoration ITALIC
A decoration which makes text appear in italics.- Since:
- 4.0.0
-
-
Field Detail
-
NAMES
public static final Index<String,TextDecoration> NAMES
The name map.- Since:
- 4.0.0
-
-
Method Detail
-
values
public static TextDecoration[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TextDecoration c : TextDecoration.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TextDecoration valueOf(String name)
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
-
as
@Deprecated @NotNull public final @NotNull TextDecorationAndState as(boolean state)
Deprecated.for removal since 4.10.0, usewithState(boolean)
insteadCreates aTextDecorationAndState
, annotating this decoration with the givenstate
.- Parameters:
state
- the state- Returns:
- a
TextDecorationAndState
- Since:
- 4.8.0
-
as
@Deprecated @NotNull public final @NotNull TextDecorationAndState as(@NotNull @NotNull TextDecoration.State state)
Deprecated.for removal since 4.10.0, usewithState(State)
insteadCreates aTextDecorationAndState
, annotating this decoration with the givenstate
.- Parameters:
state
- the state- Returns:
- a
TextDecorationAndState
- Since:
- 4.8.0
-
withState
@NotNull public final @NotNull TextDecorationAndState withState(boolean state)
An alias foras(boolean)
.- Parameters:
state
- the state- Returns:
- a
TextDecorationAndState
- Since:
- 4.10.0
-
withState
@NotNull public final @NotNull TextDecorationAndState withState(@NotNull @NotNull TextDecoration.State state)
An alias foras(State)
.- Parameters:
state
- the state- Returns:
- a
TextDecorationAndState
- Since:
- 4.10.0
-
withState
@NotNull public final @NotNull TextDecorationAndState withState(@NotNull @NotNull TriState state)
An alias foras(State)
.- Parameters:
state
- the state- Returns:
- a
TextDecorationAndState
- Since:
- 4.10.0
-
styleApply
public void styleApply(@NotNull Style.Builder style)
Description copied from interface:StyleBuilderApplicable
Applies tostyle
.- Specified by:
styleApply
in interfaceStyleBuilderApplicable
- Parameters:
style
- the style builder
-
toString
@NotNull public @NotNull String toString()
- Overrides:
toString
in classEnum<TextDecoration>
-
-