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 a BaseComponent.
  • Constructor Details

    • ComponentStyle

      public ComponentStyle(ChatColor color, Color shadowColor, String font, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated)
      Creates a new ComponentStyle instance.
      Parameters:
      color - The color of this style.

      Warning: This should be a color, not formatting code (ie, ChatColor.color should 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

      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
    • getShadowColor

      public Color 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

      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 no formatting explicitly set.
      Returns:
      true if no value is set, false if at least one is set
    • clone

      public ComponentStyle clone()
      Overrides:
      clone in class Object
    • builder

      public static ComponentStyleBuilder builder()
      Returns:
      the builder
    • builder

      public static ComponentStyleBuilder builder(ComponentStyle other)
      Get a new ComponentStyleBuilder with values initialized to the style values of the supplied ComponentStyle.
      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.

      Warning: This should be a color, not formatting code (ie, ChatColor.color should not be null).

    • setShadowColor

      public void setShadowColor(Color shadowColor)
      The shadow 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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object