- java.lang.Object
-
- org.apache.logging.log4j.message.ObjectMessage
-
- All Implemented Interfaces:
Message
,StringBuilderFormattable
public class ObjectMessage extends Object implements Message, StringBuilderFormattable
Handles messages that contain an Object.
-
-
Constructor Summary
Constructors Constructor Description ObjectMessage(Object obj)
Creates the ObjectMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
void
formatTo(StringBuilder buffer)
Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.String
getFormat()
Returns the object formatted using its toString method.String
getFormattedMessage()
Returns the formatted object message.Object
getParameter()
Returns the object parameter.Object[]
getParameters()
Returns the object as if it were a parameter.Throwable
getThrowable()
Gets the message if it is a throwable.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
ObjectMessage
public ObjectMessage(Object obj)
Creates the ObjectMessage.- Parameters:
obj
- The Object to format.
-
-
Method Detail
-
getFormattedMessage
public String getFormattedMessage()
Returns the formatted object message.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- the formatted object message.
-
formatTo
public void formatTo(StringBuilder buffer)
Description copied from interface:StringBuilderFormattable
Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.- Specified by:
formatTo
in interfaceStringBuilderFormattable
- Parameters:
buffer
- the StringBuilder to write into
-
getFormat
public String getFormat()
Returns the object formatted using its toString method.
-
getParameter
public Object getParameter()
Returns the object parameter.- Returns:
- The object.
- Since:
- 2.7
-
getParameters
public Object[] getParameters()
Returns the object as if it were a parameter.- Specified by:
getParameters
in interfaceMessage
- Returns:
- The object.
-
getThrowable
public Throwable getThrowable()
Gets the message if it is a throwable.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the message if it is a throwable.
-
-