Package org.apache.logging.log4j.message
Class MessageFormatMessage
- java.lang.Object
-
- org.apache.logging.log4j.message.MessageFormatMessage
-
- All Implemented Interfaces:
java.io.Serializable,Message
public class MessageFormatMessage extends java.lang.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(java.lang.String messagePattern, java.lang.Object... parameters)Constructs a message.MessageFormatMessage(java.util.Locale locale, java.lang.String messagePattern, java.lang.Object... parameters)Constructs a message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetFormat()Returns the message pattern.java.lang.StringgetFormattedMessage()Returns the formatted message.java.lang.Object[]getParameters()Returns the message parameters.java.lang.ThrowablegetThrowable()Return the throwable passed to the Message.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
MessageFormatMessage
public MessageFormatMessage(java.util.Locale locale, java.lang.String messagePattern, java.lang.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
-
MessageFormatMessage
public MessageFormatMessage(java.lang.String messagePattern, java.lang.Object... parameters)Constructs a message.- Parameters:
messagePattern- the pattern for this message formatparameters- The objects to format
-
-
Method Detail
-
getFormattedMessage
public java.lang.String getFormattedMessage()
Returns the formatted message.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the formatted message.
-
getFormat
public java.lang.String getFormat()
Returns the message pattern.
-
getParameters
public java.lang.Object[] getParameters()
Returns the message parameters.- Specified by:
getParametersin interfaceMessage- Returns:
- the message parameters.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getThrowable
public java.lang.Throwable getThrowable()
Return the throwable passed to the Message.- Specified by:
getThrowablein interfaceMessage- Returns:
- the Throwable.
-
-