Class ComponentJoiner

java.lang.Object
com.thewinterframework.component.ComponentJoiner

public class ComponentJoiner extends Object
Utility class for joining components with a delimiter.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComponentJoiner(@NotNull net.kyori.adventure.text.Component delimiter)
    Creates a new component joiner with the given delimiter.
  • Method Summary

    Modifier and Type
    Method
    Description
    append(@NotNull net.kyori.adventure.text.Component component)
    Appends a component to the joiner.
    net.kyori.adventure.text.Component
     
    boolean
     
    static net.kyori.adventure.text.Component
    newLine(@NotNull List<net.kyori.adventure.text.Component> components)
    Creates a new component joiner with newlines as the delimiter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ComponentJoiner

      public ComponentJoiner(@NotNull @NotNull net.kyori.adventure.text.Component delimiter)
      Creates a new component joiner with the given delimiter.
      Parameters:
      delimiter - The delimiter to use.
  • Method Details

    • newLine

      public static net.kyori.adventure.text.Component newLine(@NotNull @NotNull List<net.kyori.adventure.text.Component> components)
      Creates a new component joiner with newlines as the delimiter.
      Parameters:
      components - The components to join.
    • append

      public ComponentJoiner append(@NotNull @NotNull net.kyori.adventure.text.Component component)
      Appends a component to the joiner.
      Parameters:
      component - The component to append.
      Returns:
      The component joiner.
    • component

      public net.kyori.adventure.text.Component component()
      Returns:
      The joined component.
    • isEmpty

      public boolean isEmpty()
      Returns:
      Whether the joiner is empty.