Class BasicMessageBuilder

  • All Implemented Interfaces:
    MessageBuilder

    public class BasicMessageBuilder
    extends Object
    implements MessageBuilder
    A basic message builder creates the messages following this pattern: [category]:[LEVEL]=[id] followed by the arguments (if any) separated by spaces, then the full stack trace of a throwable (if any).
    • Field Detail

      • INSTANCE

        public static final BasicMessageBuilder INSTANCE
        An instance of BasicMessageBuilder.
    • Constructor Detail

      • BasicMessageBuilder

        public BasicMessageBuilder()
    • Method Detail

      • buildMessage

        public String buildMessage​(char level,
                                   String category,
                                   int id)
        Description copied from interface: MessageBuilder
        Builds a message.
        Specified by:
        buildMessage in interface MessageBuilder
        Parameters:
        level - the level of the message.
        category - the category of the message.
        id - the ID of the message.
        Returns:
        a message.
      • buildMessage

        public String buildMessage​(char level,
                                   String category,
                                   int id,
                                   Object... arguments)
        Description copied from interface: MessageBuilder
        Builds a message with arguments.
        Specified by:
        buildMessage in interface MessageBuilder
        Parameters:
        level - the level of the message.
        category - the category of the message.
        id - the ID of the message.
        arguments - the arguments.
        Returns:
        a message.
      • buildMessage

        public String buildMessage​(char level,
                                   String category,
                                   int id,
                                   Throwable t)
        Description copied from interface: MessageBuilder
        Builds a message with a throwable.
        Specified by:
        buildMessage in interface MessageBuilder
        Parameters:
        level - the level of the message.
        category - the category of the message.
        id - the ID of the message.
        t - the throwable.
        Returns:
        a message.
      • buildMessage

        public String buildMessage​(char level,
                                   String category,
                                   int id,
                                   Throwable t,
                                   Object... arguments)
        Description copied from interface: MessageBuilder
        Builds a message with a throwable and arguments.
        Specified by:
        buildMessage in interface MessageBuilder
        Parameters:
        level - the level of the message.
        category - the category of the message.
        id - the ID of the message.
        t - the throwable.
        arguments - the arguments.
        Returns:
        a message.