public class ReusableSimpleMessage extends Object implements ReusableMessage, CharSequence
Constructor and Description |
---|
ReusableSimpleMessage() |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
void |
formatTo(StringBuilder buffer)
Writes a text representation of this object into the specified
StringBuilder , ideally without allocating
temporary objects. |
String |
getFormat()
Gets the format portion of the Message.
|
String |
getFormattedMessage()
Gets the Message formatted as a String.
|
short |
getParameterCount()
This message does not have any parameters so this method always returns zero.
|
Object[] |
getParameters()
Gets parameter values, if any.
|
Throwable |
getThrowable()
Gets the throwable, if any.
|
int |
length() |
Message |
memento()
Returns an immutable snapshot of the current internal state of this reusable message.
|
void |
set(CharSequence charSequence) |
void |
set(String message) |
CharSequence |
subSequence(int start,
int end) |
Object[] |
swapParameters(Object[] emptyReplacement)
This message does not have any parameters, so this method returns the specified array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public void set(String message)
public void set(CharSequence charSequence)
public String getFormattedMessage()
Message
This method will not be called for Messages that implement the
StringBuilderFormattable
interface: instead, the
formatTo(StringBuilder)
method will be called so the
Message can format its contents without creating intermediate String objects.
getFormattedMessage
in interface Message
public String getFormat()
Message
getFormat
in interface Message
public Object[] getParameters()
Message
getParameters
in interface Message
public Throwable getThrowable()
Message
getThrowable
in interface Message
public void formatTo(StringBuilder buffer)
StringBuilderFormattable
StringBuilder
, ideally without allocating
temporary objects.formatTo
in interface StringBuilderFormattable
buffer
- the StringBuilder to write intopublic Object[] swapParameters(Object[] emptyReplacement)
swapParameters
in interface ReusableMessage
emptyReplacement
- the parameter array to returnReusableMessage.getParameterCount()
public short getParameterCount()
getParameterCount
in interface ReusableMessage
public Message memento()
ReusableMessage
memento
in interface ReusableMessage
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
Copyright © 1999-2016 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.