Interface MessageBuilder

All Superinterfaces:
Appendable
All Known Implementing Classes:
DefaultMessageBuilder

public interface MessageBuilder extends Appendable
Message builder that supports configurable styling.
Since:
4.0.0
See Also:
  • Method Details

    • trace

      @Nonnull default MessageBuilder trace(Object message)
      Append message content in trace style. By default, bold magenta
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • debug

      @Nonnull default MessageBuilder debug(Object message)
      Append message content in debug style. By default, bold cyan
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • info

      @Nonnull default MessageBuilder info(Object message)
      Append message content in info style. By default, bold blue
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • warning

      @Nonnull default MessageBuilder warning(Object message)
      Append message content in warning style. By default, bold yellow
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • error

      @Nonnull default MessageBuilder error(Object message)
      Append message content in error style. By default, bold red
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • success

      @Nonnull default MessageBuilder success(Object message)
      Append message content in success style. By default, bold green
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • failure

      @Nonnull default MessageBuilder failure(Object message)
      Append message content in failure style. By default, bold red
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • strong

      @Nonnull default MessageBuilder strong(Object message)
      Append message content in strong style. By default, bold
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • mojo

      @Nonnull default MessageBuilder mojo(Object message)
      Append message content in mojo style. By default, green
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • project

      @Nonnull default MessageBuilder project(Object message)
      Append message content in project style. By default, cyan
      Parameters:
      message - the message to append
      Returns:
      the current builder
    • style

      @Nonnull default MessageBuilder style(String style, Object message)
    • style

      MessageBuilder style(String style)
    • resetStyle

      MessageBuilder resetStyle()
    • append

      Specified by:
      append in interface Appendable
    • append

      @Nonnull MessageBuilder append(CharSequence cs, int start, int end)
      Specified by:
      append in interface Appendable
    • append

      @Nonnull MessageBuilder append(char c)
      Specified by:
      append in interface Appendable
    • a

      @Nonnull default MessageBuilder a(char[] value, int offset, int len)
      Append content to the message buffer.
      Parameters:
      value - the content to append
      offset - the index of the first char to append
      len - the number of chars to append
      Returns:
      the current builder
    • a

      @Nonnull default MessageBuilder a(char[] value)
      Append content to the message buffer.
      Parameters:
      value - the content to append
      Returns:
      the current builder
    • a

      @Nonnull default MessageBuilder a(CharSequence value, int start, int end)
      Append content to the message buffer.
      Parameters:
      value - the content to append
      start - the starting index of the subsequence to be appended
      end - the end index of the subsequence to be appended
      Returns:
      the current builder
    • a

      Append content to the message buffer.
      Parameters:
      value - the content to append
      Returns:
      the current builder
    • a

      @Nonnull default MessageBuilder a(Object value)
      Append content to the message buffer.
      Parameters:
      value - the content to append
      Returns:
      the current builder
    • newline

      @Nonnull default MessageBuilder newline()
      Append newline to the message buffer.
      Returns:
      the current builder
    • format

      @Nonnull default MessageBuilder format(String pattern, Object... args)
      Append formatted content to the buffer.
      Parameters:
      pattern - a format string
      args - arguments referenced by the format specifiers in the format string
      Returns:
      the current builder
      See Also:
    • setLength

      MessageBuilder setLength(int length)
      Set the buffer length.
      Parameters:
      length - the new length
      Returns:
      the current builder
    • build

      @Nonnull String build()
      Return the built message.
      Returns:
      the message