Class ObjectArrayMessage

java.lang.Object
org.apache.logging.log4j.message.ObjectArrayMessage
All Implemented Interfaces:
Serializable, Message

public final class ObjectArrayMessage extends Object implements Message
Handles messages that contain an Object[].

Created for use with the CSV layout. For example:

logger.debug(new ObjectArrayMessage(1, 2, "Bob"));

Since:
2.4
See Also:
  • Constructor Details

    • ObjectArrayMessage

      public ObjectArrayMessage(Object... obj)
      Creates the ObjectMessage.
      Parameters:
      obj - The Object to format.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getFormat

      public String getFormat()
      Returns the object formatted using its toString method.
      Specified by:
      getFormat in interface Message
      Returns:
      the String representation of the object.
    • getFormattedMessage

      public String getFormattedMessage()
      Returns the formatted object message.
      Specified by:
      getFormattedMessage in interface Message
      Returns:
      the formatted object message.
    • getParameters

      public Object[] getParameters()
      Returns the object as if it were a parameter.
      Specified by:
      getParameters in interface Message
      Returns:
      The object.
    • getThrowable

      public Throwable getThrowable()
      Returns null.
      Specified by:
      getThrowable in interface Message
      Returns:
      null.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object