Package net.md_5.bungee.api.chat

# Class ComponentStyleBuilder

java.lang.Object
net.md_5.bungee.api.chat.ComponentStyleBuilder

public final class ComponentStyleBuilder extends Object

ComponentStyleBuilder simplifies creating component styles by allowing the use of a chainable builder.

     ComponentStyle style = ComponentStyle.builder()
         .color(ChatColor.RED)
         .font("custom:font")
         .bold(true).italic(true).create();

     BaseComponent component = new ComponentBuilder("Hello world").style(style).create();
     // Or it can be used directly on a component
     TextComponent text = new TextComponent("Hello world");
     text.applyStyle(style);

See Also:
  - `ComponentStyle.builder()`
  - `ComponentStyle.builder(ComponentStyle)`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComponentStyleBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ComponentStyleBuilder`
  `bold(Boolean bold)`
  Set the style's bold property.
  `ComponentStyle`
  `build()`
  Build the `ComponentStyle` using the values set in this builder.
  `ComponentStyleBuilder`
  `color(ChatColor color)`
  Set the style color.
  `ComponentStyleBuilder`
  `font(String font)`
  Set the style font.
  `ComponentStyleBuilder`
  `italic(Boolean italic)`
  Set the style's italic property.
  `ComponentStyleBuilder`
  `obfuscated(Boolean obfuscated)`
  Set the style's obfuscated property.
  `ComponentStyleBuilder`
  `shadowColor(Color shadowColor)`
  Set the style shadow color.
  `ComponentStyleBuilder`
  `strikethrough(Boolean strikethrough)`
  Set the style's strikethrough property.
  `ComponentStyleBuilder`
  `underlined(Boolean underlined)`
  Set the style's underlined property.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ComponentStyleBuilder

    public ComponentStyleBuilder()

- ## Method Details

  - ### color

    public ComponentStyleBuilder color(ChatColor color)
    Set the style color.
    Parameters:
      `color` - the color to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### shadowColor

    public ComponentStyleBuilder shadowColor(Color shadowColor)
    Set the style shadow color.
    Parameters:
      `shadowColor` - the shadow color to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### font

    public ComponentStyleBuilder font(String font)
    Set the style font.
    Parameters:
      `font` - the font key to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### bold

    public ComponentStyleBuilder bold(Boolean bold)
    Set the style's bold property.
    Parameters:
      `bold` - the bold value to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### italic

    public ComponentStyleBuilder italic(Boolean italic)
    Set the style's italic property.
    Parameters:
      `italic` - the italic value to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### underlined

    public ComponentStyleBuilder underlined(Boolean underlined)
    Set the style's underlined property.
    Parameters:
      `underlined` - the underlined value to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### strikethrough

    public ComponentStyleBuilder strikethrough(Boolean strikethrough)
    Set the style's strikethrough property.
    Parameters:
      `strikethrough` - the strikethrough value to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### obfuscated

    public ComponentStyleBuilder obfuscated(Boolean obfuscated)
    Set the style's obfuscated property.
    Parameters:
      `obfuscated` - the obfuscated value to set, or null to use the default
    Returns:
      this ComponentStyleBuilder for chaining

  - ### build

    public ComponentStyle build()
    Build the `ComponentStyle` using the values set in this builder.
    Returns:
      the created ComponentStyle