Package net.md_5.bungee.api.chat
Class ComponentStyle
java.lang.Object
net.md_5.bungee.api.chat.ComponentStyle
- All Implemented Interfaces:
Cloneable
Represents a style that may be applied to a
BaseComponent.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentStyleBuilderbuilder()Get a newComponentStyleBuilder.static ComponentStyleBuilderbuilder(ComponentStyle other) Get a newComponentStyleBuilderwith values initialized to the style values of the suppliedComponentStyle.clone()booleangetColor()Returns the color of this style.getFont()Returns the font of this style.Returns the shadow color 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()booleanReturns whether or not this style has a shadow color set.booleanisBold()Returns whether this style is bold.Returns whether this style is bold.booleanisEmpty()Returns whether this style has no formatting explicitly set.booleanisItalic()Returns whether this style is italic.Returns whether this style is italic.booleanReturns whether this style is obfuscated.Returns whether this style is obfuscated.booleanReturns whether this style is strikethroughReturns whether this style is strikethrough.booleanReturns whether this style is underlined.Returns whether this style is underlined.voidWhether this style is bold.voidThe color of this style.voidThe font of this style.voidWhether this style is italic.voidsetObfuscated(Boolean obfuscated) Whether this style is obfuscated.voidsetShadowColor(Color shadowColor) The shadow color of this style.voidsetStrikethrough(Boolean strikethrough) Whether this style is strikethrough.voidsetUnderlined(Boolean underlined) Whether this style is underlined.
-
Constructor Details
-
ComponentStyle
public ComponentStyle(ChatColor color, Color shadowColor, String font, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated) Creates a newComponentStyleinstance.- Parameters:
color- The color of this style.Warning: This should be a color, not formatting code (ie,
ChatColor.colorshould not be null).shadowColor- The shadow color of this style.font- The font of this style.bold- Whether this style is bold.italic- Whether this style is italic.underlined- Whether this style is underlined.strikethrough- Whether this style is strikethrough.obfuscated- Whether this style is obfuscated.
-
ComponentStyle
public ComponentStyle()
-
-
Method Details
-
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
-
getShadowColor
Returns the shadow color of this style. May return null.- Returns:
- the shadow color of this style, or null if default color
-
hasShadowColor
public boolean hasShadowColor()Returns whether or not this style has a shadow color set.- Returns:
- whether a shadow color is set
-
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
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
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
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
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
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 no formatting explicitly set.- Returns:
- true if no value is set, false if at least one is set
-
clone
-
builder
Get a newComponentStyleBuilder.- Returns:
- the builder
-
builder
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
The color of this style.Warning: This should be a color, not formatting code (ie,
ChatColor.colorshould not be null). -
setShadowColor
The shadow color of this style. -
setFont
The font of this style. -
setBold
Whether this style is bold. -
setItalic
Whether this style is italic. -
setUnderlined
Whether this style is underlined. -
setStrikethrough
Whether this style is strikethrough. -
setObfuscated
Whether this style is obfuscated. -
equals
-
hashCode
public int hashCode()
-