Package org.apache.logging.log4j.message
Class StringFormattedMessage
- java.lang.Object
-
- org.apache.logging.log4j.message.StringFormattedMessage
-
- All Implemented Interfaces:
Serializable,Message
public class StringFormattedMessage extends Object implements Message
Handles messages that consist of a format string conforming toFormatter.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringFormattedMessage(String messagePattern, Object... arguments)Constructs a message.StringFormattedMessage(Locale locale, String messagePattern, Object... arguments)Constructs a message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)protected StringformatMessage(String msgPattern, Object... args)StringgetFormat()Returns the message pattern.StringgetFormattedMessage()Returns the formatted message.Object[]getParameters()Returns the message parameters.ThrowablegetThrowable()Return the throwable passed to the Message.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
StringFormattedMessage
public StringFormattedMessage(Locale locale, String messagePattern, Object... arguments)
Constructs a message.- Parameters:
locale- the locale for this message formatmessagePattern- the pattern for this message formatarguments- The objects to format- Since:
- 2.6
-
-
Method Detail
-
getFormattedMessage
public String getFormattedMessage()
Returns the formatted message.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the formatted message.
-
getFormat
public String getFormat()
Returns the message pattern.
-
getParameters
public Object[] getParameters()
Returns the message parameters.- Specified by:
getParametersin interfaceMessage- Returns:
- the message parameters.
-
getThrowable
public Throwable getThrowable()
Return the throwable passed to the Message.- Specified by:
getThrowablein interfaceMessage- Returns:
- the Throwable.
-
-