Package net.kyori.ansi
Interface StyleOps<S>
-
- Type Parameters:
S
- style type
public interface StyleOps<S>
Data query operations that can be performed on a style-containing object.Each chat component has a style, and any unset values are inherited from that component's parent.
- Since:
- 1.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
StyleOps.State
Represents possible states for a decoration.
-
Field Summary
Fields Modifier and Type Field Description static int
COLOR_UNSET
Indicates that the queried style has no color set.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StyleOps.State
bold(S style)
Whether the style indicates a component is bold or not.@org.jetbrains.annotations.Range(from=-1L, to=16777215L) int
color(S style)
Get the color as an int-packed RGB value.@Nullable java.lang.String
font(S style)
Get the style's declared font as a string representing a resource location.StyleOps.State
italics(S style)
Get the italic value from this style.StyleOps.State
obfuscated(S style)
Get the obfuscated value from this style.StyleOps.State
strikethrough(S style)
Get the strikethrough value from this style.StyleOps.State
underlined(S style)
Get the underlined value from this style.
-
-
-
Field Detail
-
COLOR_UNSET
static final int COLOR_UNSET
Indicates that the queried style has no color set.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
bold
StyleOps.State bold(@NotNull S style)
Whether the style indicates a component is bold or not.- Parameters:
style
- the active style- Returns:
- if bold
- Since:
- 1.0.0
-
italics
StyleOps.State italics(@NotNull S style)
Get the italic value from this style.- Parameters:
style
- the active style- Returns:
- if italic
- Since:
- 1.0.0
-
underlined
StyleOps.State underlined(@NotNull S style)
Get the underlined value from this style.- Parameters:
style
- the active style- Returns:
- if underlined
- Since:
- 1.0.0
-
strikethrough
StyleOps.State strikethrough(@NotNull S style)
Get the strikethrough value from this style.- Parameters:
style
- the active style- Returns:
- if struck-through
- Since:
- 1.0.0
-
obfuscated
StyleOps.State obfuscated(@NotNull S style)
Get the obfuscated value from this style.- Parameters:
style
- the active style- Returns:
- if obfuscated ('magic' text)
- Since:
- 1.0.0
-
color
@org.jetbrains.annotations.Range(from=-1L, to=16777215L) int color(@NotNull S style)
Get the color as an int-packed RGB value.- Parameters:
style
- the active style- Returns:
- the text color, or -1 if no color is set
- Since:
- 1.0.0
-
font
@Nullable @Nullable java.lang.String font(@NotNull S style)
Get the style's declared font as a string representing a resource location.- Parameters:
style
- the active style- Returns:
- the font, if any is present
- Since:
- 1.0.0
-
-