Package org.apache.logging.log4j.message
Class MessageFormatMessage
- java.lang.Object
-
- org.apache.logging.log4j.message.MessageFormatMessage
-
- All Implemented Interfaces:
Serializable
,Message
public class MessageFormatMessage extends Object implements Message
Handles messages that consist of a format string conforming to java.text.MessageFormat.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MessageFormatMessage(String messagePattern, Object... parameters)
Constructs a message.MessageFormatMessage(Locale locale, String messagePattern, Object... parameters)
Constructs a message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
protected String
formatMessage(String msgPattern, Object... args)
String
getFormat()
Returns the message pattern.String
getFormattedMessage()
Returns the formatted message.Object[]
getParameters()
Returns the message parameters.Throwable
getThrowable()
Return the throwable passed to the Message.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
MessageFormatMessage
public MessageFormatMessage(Locale locale, String messagePattern, Object... parameters)
Constructs a message.- Parameters:
locale
- the locale for this message formatmessagePattern
- the pattern for this message formatparameters
- The objects to format- Since:
- 2.6
-
-
Method Detail
-
getFormattedMessage
public String getFormattedMessage()
Returns the formatted message.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- the formatted message.
-
getFormat
public String getFormat()
Returns the message pattern.
-
getParameters
public Object[] getParameters()
Returns the message parameters.- Specified by:
getParameters
in interfaceMessage
- Returns:
- the message parameters.
-
getThrowable
public Throwable getThrowable()
Return the throwable passed to the Message.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the Throwable.
-
-