Package org.apache.logging.log4j.message
Class ObjectMessage
java.lang.Object
org.apache.logging.log4j.message.ObjectMessage
- All Implemented Interfaces:
Serializable
,Message
,StringBuilderFormattable
Handles messages that contain an Object.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
formatTo
(StringBuilder buffer) Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.Returns the object formatted using its toString method.Returns the formatted object message.Returns the object parameter.Object[]
Returns the object as if it were a parameter.Gets the message if it is a throwable.int
hashCode()
toString()
-
Constructor Details
-
ObjectMessage
Creates the ObjectMessage.- Parameters:
obj
- The Object to format.
-
-
Method Details
-
getFormattedMessage
Returns the formatted object message.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- the formatted object message.
-
formatTo
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
Returns the object formatted using its toString method. -
getParameter
Returns the object parameter.- Returns:
- The object.
- Since:
- 2.7
-
getParameters
Returns the object as if it were a parameter.- Specified by:
getParameters
in interfaceMessage
- Returns:
- The object.
-
equals
-
hashCode
public int hashCode() -
toString
-
getThrowable
Gets the message if it is a throwable.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the message if it is a throwable.
-