Thread-safety note: the contents of this message can be modified after construction.
When using asynchronous loggers and appenders it is not recommended to modify this message after the message is
logged, because it is undefined whether the logged message string will contain the old values or the modified
values.

forEach

Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.

Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
BiConsumer's BiConsumer.accept(Object, Object) accept} method may cause a
ConcurrentModificationException to be thrown.

Type Parameters:

CV - type of the consumer value

Parameters:

action - The action to be performed for each key-value pair in this collection

forEach

Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.

The third parameter lets callers pass in a stateful object to be modified with the key-value pairs,
so the TriConsumer implementation itself can be stateless and potentially reusable.

Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
TriConsumer's accept method may cause a
ConcurrentModificationException to be thrown.

Type Parameters:

CV - type of the consumer value

S - type of the third parameter

Parameters:

action - The action to be performed for each key-value pair in this collection

state - the object to be passed as the third parameter to each invocation on the specified
triconsumer

formats - An array of Strings that provide extra information about how to format the message. MapMessage uses
the first format specifier it recognizes. The supported formats are XML, JSON, and JAVA. The default
format is key1="value1" key2="value2" as required by RFC
5424 messages.

formats - An array of Strings that provide extra information about how to format the message.
Each MultiFormatStringBuilderFormattable implementation is free to use the provided formats however they choose.