org.apache.logging.log4j.message
Class StringFormattedMessage

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

public class StringFormattedMessage
extends Object
implements Message, Serializable

Handles messages that consist of a format string conforming to java.util.Formatter.

See Also:
Serialized Form

Constructor Summary
StringFormattedMessage()
          Create the StringFormattedMessage.
StringFormattedMessage(String messagePattern, Object... arguments)
           
 
Method Summary
 boolean equals(Object o)
           
protected  String formatMessage(String msgPattern, Object... args)
           
 String getFormattedMessage()
          Return the formatted message.
 String getMessageFormat()
          Returns the message pattern.
 Object[] getParameters()
          Returns the message parameters.
 int hashCode()
           
 void setMessageFormat(String messagePattern)
          Set the message pattern.
 void setParameters(Object[] parameters)
          Sets the parameters for the message.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringFormattedMessage

public StringFormattedMessage()
Create the StringFormattedMessage.


StringFormattedMessage

public StringFormattedMessage(String messagePattern,
                              Object... arguments)
Method Detail

getFormattedMessage

public String getFormattedMessage()
Return the formatted message.

Specified by:
getFormattedMessage in interface Message
Returns:
the formatted message.

getMessageFormat

public String getMessageFormat()
Returns the message pattern.

Specified by:
getMessageFormat in interface Message
Returns:
the message pattern.

setMessageFormat

public void setMessageFormat(String messagePattern)
Set the message pattern.

Parameters:
messagePattern - The message pattern.

getParameters

public Object[] getParameters()
Returns the message parameters.

Specified by:
getParameters in interface Message
Returns:
the message parameters.

setParameters

public void setParameters(Object[] parameters)
Sets the parameters for the message.

Parameters:
parameters - The parameters.

formatMessage

protected String formatMessage(String msgPattern,
                               Object... args)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.