Package org.apache.logging.log4j.message
Class StructuredDataCollectionMessage
java.lang.Object
org.apache.logging.log4j.message.StructuredDataCollectionMessage
- All Implemented Interfaces:
Serializable
,Iterable<StructuredDataMessage>
,Message
,MessageCollectionMessage<StructuredDataMessage>
,StringBuilderFormattable
public class StructuredDataCollectionMessage
extends Object
implements StringBuilderFormattable, MessageCollectionMessage<StructuredDataMessage>
A collection of StructuredDataMessages.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
formatTo
(StringBuilder buffer) Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.This method has unclear semantics and inconsistent implementations – its usage is strongly discouraged.Gets the Message formatted as a String.Object[]
Gets parameter values, if any.Gets the throwable, if any.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StructuredDataCollectionMessage
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<StructuredDataMessage>
-
getFormattedMessage
Description copied from interface:Message
Gets the Message formatted as a String. Each Message implementation determines the appropriate way to format the data encapsulated in the Message. Messages that provide more than one way of formatting the Message will implement MultiformatMessage.When configured to log asynchronously, this method is called before the Message is queued, unless this message implements
ReusableMessage
or is annotated withAsynchronouslyFormattable
. This gives the Message implementation class a chance to create a formatted message String with the current value of any mutable objects. The intention is that the Message implementation caches this formatted message and returns it on subsequent calls. (See LOG4J2-763.)When logging synchronously, this method will not be called for Messages that implement the
StringBuilderFormattable
interface: instead, theformatTo(StringBuilder)
method will be called so the Message can format its contents without creating intermediate String objects.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- The message String.
-
getFormat
Description copied from interface:Message
This method has unclear semantics and inconsistent implementations – its usage is strongly discouraged. -
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
-
getParameters
Description copied from interface:Message
Gets parameter values, if any.- Specified by:
getParameters
in interfaceMessage
- Returns:
- An array of parameter values or null.
-
getThrowable
Description copied from interface:Message
Gets the throwable, if any.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- the throwable or null.
-