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 boolean
equals(java.lang.Object o)
java.lang.String
getFormat()
Returns the message pattern.java.lang.String
getFormattedMessage()
Returns the formatted message.java.lang.Object[]
getParameters()
Returns the message parameters.java.lang.Throwable
getThrowable()
Return the throwable passed to the Message.int
hashCode()
java.lang.String
toString()
-
-
-
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:
getFormattedMessage
in 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:
getParameters
in interfaceMessage
- Returns:
- the message parameters.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getThrowable
public java.lang.Throwable getThrowable()
Return the throwable passed to the Message.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the Throwable.
-
-