Package ej.util.message.basic
Class BasicMessageBuilder
- java.lang.Object
-
- ej.util.message.basic.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 Summary
Fields Modifier and Type Field Description static BasicMessageBuilderINSTANCEAn instance of BasicMessageBuilder.
-
Constructor Summary
Constructors Constructor Description BasicMessageBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbuildMessage(char level, String category, int id)Builds a message.StringbuildMessage(char level, String category, int id, Object... arguments)Builds a message with arguments.StringbuildMessage(char level, String category, int id, Throwable t)Builds a message with a throwable.StringbuildMessage(char level, String category, int id, Throwable t, Object... arguments)Builds a message with a throwable and arguments.
-
-
-
Field Detail
-
INSTANCE
public static final BasicMessageBuilder INSTANCE
An instance of BasicMessageBuilder.
-
-
Method Detail
-
buildMessage
public String buildMessage(char level, String category, int id)
Description copied from interface:MessageBuilderBuilds a message.- Specified by:
buildMessagein interfaceMessageBuilder- 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:MessageBuilderBuilds a message with arguments.- Specified by:
buildMessagein interfaceMessageBuilder- 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:MessageBuilderBuilds a message with a throwable.- Specified by:
buildMessagein interfaceMessageBuilder- 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:MessageBuilderBuilds a message with a throwable and arguments.- Specified by:
buildMessagein interfaceMessageBuilder- 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.
-
-