Package org.apache.logging.log4j.message
Class StringFormattedMessage
java.lang.Object
org.apache.logging.log4j.message.StringFormattedMessage
- All Implemented Interfaces:
Serializable
,Message
Handles messages that consist of a format string conforming to
Formatter
.
Note to implementors
This class implements the unrolled args API even though StringFormattedMessage does not. This leaves the room for StringFormattedMessage to unroll itself later.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStringFormattedMessage
(String messagePattern, Object... arguments) Constructs a message.StringFormattedMessage
(Locale locale, String messagePattern, Object... arguments) Constructs a message. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected String
formatMessage
(String msgPattern, Object... args) Returns the message pattern.Returns the formatted message.Object[]
Returns the message parameters.Return the throwable passed to the Message.int
hashCode()
private void
toString()
private void
-
Field Details
-
LOGGER
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
HASHVAL
private static final int HASHVAL- See Also:
-
messagePattern
-
argArray
-
stringArgs
-
formattedMessage
-
throwable
-
locale
-
-
Constructor Details
-
StringFormattedMessage
Constructs a message.- Parameters:
locale
- the locale for this message formatmessagePattern
- the pattern for this message formatarguments
- The objects to format- Since:
- 2.6
-
StringFormattedMessage
Constructs a message.- Parameters:
messagePattern
- the pattern for this message formatarguments
- The objects to format- Since:
- 2.6
-
-
Method Details
-
getFormattedMessage
Returns the formatted message.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- the formatted message.
-
getFormat
Returns the message pattern. -
getParameters
Returns the message parameters.- Specified by:
getParameters
in interfaceMessage
- Returns:
- the message parameters.
-
formatMessage
-
equals
-
hashCode
public int hashCode() -
toString
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
ClassNotFoundException
-
getThrowable
Return the throwable passed to the Message.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the Throwable.
-