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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanequalObjectsOrStrings(Object left, Object right) booleanvoidformatTo(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.inthashCode()private voidtoString()private void
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
obj
-
objectString
-
-
Constructor Details
-
ObjectMessage
Creates the ObjectMessage.- Parameters:
obj- The Object to format.
-
-
Method Details
-
getFormattedMessage
Returns the formatted object message.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the formatted object message.
-
formatTo
Description copied from interface:StringBuilderFormattableWrites a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.- Specified by:
formatToin 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:
getParametersin interfaceMessage- Returns:
- The object.
-
equals
-
equalObjectsOrStrings
-
hashCode
public int hashCode() -
toString
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
getThrowable
Gets the message if it is a throwable.- Specified by:
getThrowablein interfaceMessage- Returns:
- the message if it is a throwable.
-