Package net.md_5.bungee.api.chat
Class ComponentStyle
- java.lang.Object
-
- net.md_5.bungee.api.chat.ComponentStyle
-
- All Implemented Interfaces:
Cloneable
public final class ComponentStyle extends Object implements Cloneable
Represents a style that may be applied to aBaseComponent.
-
-
Constructor Summary
Constructors Constructor Description ComponentStyle()ComponentStyle(ChatColor color, String font, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ComponentStyleBuilderbuilder()Get a newComponentStyleBuilder.static ComponentStyleBuilderbuilder(ComponentStyle other)Get a newComponentStyleBuilderwith values initialized to the style values of the suppliedComponentStyle.ComponentStyleclone()booleanequals(Object o)ChatColorgetColor()Returns the color of this style.StringgetFont()Returns the font of this style.booleanhasColor()Returns whether or not this style has a color set.booleanhasFont()Returns whether or not this style has a font set.inthashCode()booleanisBold()Returns whether this style is bold.BooleanisBoldRaw()Returns whether this style is bold.booleanisEmpty()Returns whether this style has any formatting explicitly set.booleanisItalic()Returns whether this style is italic.BooleanisItalicRaw()Returns whether this style is italic.booleanisObfuscated()Returns whether this style is obfuscated.BooleanisObfuscatedRaw()Returns whether this style is obfuscated.booleanisStrikethrough()Returns whether this style is strikethroughBooleanisStrikethroughRaw()Returns whether this style is strikethrough.booleanisUnderlined()Returns whether this style is underlined.BooleanisUnderlinedRaw()Returns whether this style is underlined.voidsetBold(Boolean bold)Whether this style is bold.voidsetColor(ChatColor color)The color of this style.voidsetFont(String font)The font of this style.voidsetItalic(Boolean italic)Whether this style is italic.voidsetObfuscated(Boolean obfuscated)Whether this style is obfuscated.voidsetStrikethrough(Boolean strikethrough)Whether this style is strikethrough.voidsetUnderlined(Boolean underlined)Whether this style is underlined.
-
-
-
Method Detail
-
getColor
public ChatColor getColor()
Returns the color of this style. May return null.- Returns:
- the color of this style, or null if default color
-
hasColor
public boolean hasColor()
Returns whether or not this style has a color set.- Returns:
- whether a color is set
-
getFont
public String getFont()
Returns the font of this style. May return null.- Returns:
- the font of this style, or null if default font
-
hasFont
public boolean hasFont()
Returns whether or not this style has a font set.- Returns:
- whether a font is set
-
isBold
public boolean isBold()
Returns whether this style is bold.- Returns:
- whether the style is bold
-
isBoldRaw
public Boolean isBoldRaw()
Returns whether this style is bold. May return null.- Returns:
- whether the style is bold, or null if not set
-
isItalic
public boolean isItalic()
Returns whether this style is italic. May return null.- Returns:
- whether the style is italic
-
isItalicRaw
public Boolean isItalicRaw()
Returns whether this style is italic. May return null.- Returns:
- whether the style is italic, or null if not set
-
isUnderlined
public boolean isUnderlined()
Returns whether this style is underlined.- Returns:
- whether the style is underlined
-
isUnderlinedRaw
public Boolean isUnderlinedRaw()
Returns whether this style is underlined. May return null.- Returns:
- whether the style is underlined, or null if not set
-
isStrikethrough
public boolean isStrikethrough()
Returns whether this style is strikethrough- Returns:
- whether the style is strikethrough
-
isStrikethroughRaw
public Boolean isStrikethroughRaw()
Returns whether this style is strikethrough. May return null.- Returns:
- whether the style is strikethrough, or null if not set
-
isObfuscated
public boolean isObfuscated()
Returns whether this style is obfuscated.- Returns:
- whether the style is obfuscated
-
isObfuscatedRaw
public Boolean isObfuscatedRaw()
Returns whether this style is obfuscated. May return null.- Returns:
- whether the style is obfuscated, or null if not set
-
isEmpty
public boolean isEmpty()
Returns whether this style has any formatting explicitly set.- Returns:
- true if at least one value is set, false if none are set
-
clone
public ComponentStyle clone()
-
builder
public static ComponentStyleBuilder builder()
Get a newComponentStyleBuilder.- Returns:
- the builder
-
builder
public static ComponentStyleBuilder builder(ComponentStyle other)
Get a newComponentStyleBuilderwith values initialized to the style values of the suppliedComponentStyle.- Parameters:
other- the component style whose values to copy into the builder- Returns:
- the builder
-
setColor
public void setColor(ChatColor color)
The color of this style.
-
setFont
public void setFont(String font)
The font of this style.
-
setBold
public void setBold(Boolean bold)
Whether this style is bold.
-
setItalic
public void setItalic(Boolean italic)
Whether this style is italic.
-
setUnderlined
public void setUnderlined(Boolean underlined)
Whether this style is underlined.
-
setStrikethrough
public void setStrikethrough(Boolean strikethrough)
Whether this style is strikethrough.
-
setObfuscated
public void setObfuscated(Boolean obfuscated)
Whether this style is obfuscated.
-
-