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:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description StructuredDataCollectionMessage(List<StructuredDataMessage> messages)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidformatTo(StringBuilder buffer)Writes a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.StringgetFormat()Gets the format portion of the Message.StringgetFormattedMessage()Gets the Message formatted as a String.Object[]getParameters()Gets parameter values, if any.ThrowablegetThrowable()Gets the throwable, if any.Iterator<StructuredDataMessage>iterator()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Constructor Detail- 
StructuredDataCollectionMessagepublic StructuredDataCollectionMessage(List<StructuredDataMessage> messages) 
 
- 
 - 
Method Detail- 
iteratorpublic Iterator<StructuredDataMessage> iterator() - Specified by:
- iteratorin interface- Iterable<StructuredDataMessage>
 
 - 
getFormattedMessagepublic String getFormattedMessage() Description copied from interface:MessageGets 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 ReusableMessageor 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 StringBuilderFormattableinterface: instead, theformatTo(StringBuilder)method will be called so the Message can format its contents without creating intermediate String objects.- Specified by:
- getFormattedMessagein interface- Message
- Returns:
- The message String.
 
 - 
getFormatpublic String getFormat() Description copied from interface:MessageGets the format portion of the Message.- Specified by:
- getFormatin interface- Message
- Returns:
- The message format. Some implementations, such as ParameterizedMessage, will use this as the message "pattern". Other Messages may simply return an empty String. TODO Do all messages have a format? What syntax? Using a Formatter object could be cleaner. (RG) In SimpleMessage the format is identical to the formatted message. In ParameterizedMessage and StructuredDataMessage it is not. It is up to the Message implementer to determine what this method will return. A Formatter is inappropriate as this is very specific to the Message implementation so it isn't clear to me how having a Formatter separate from the Message would be cleaner.
 
 - 
formatTopublic void formatTo(StringBuilder buffer) Description copied from interface:StringBuilderFormattableWrites a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.- Specified by:
- formatToin interface- StringBuilderFormattable
- Parameters:
- buffer- the StringBuilder to write into
 
 - 
getParameterspublic Object[] getParameters() Description copied from interface:MessageGets parameter values, if any.- Specified by:
- getParametersin interface- Message
- Returns:
- An array of parameter values or null.
 
 - 
getThrowablepublic Throwable getThrowable() Description copied from interface:MessageGets the throwable, if any.- Specified by:
- getThrowablein interface- Message
- Returns:
- the throwable or null.
 
 
- 
 
-