public class ReusableObjectMessage extends java.lang.Object implements ReusableMessage
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
obj |
private java.lang.String |
objectString |
private static long |
serialVersionUID |
Constructor and Description |
---|
ReusableObjectMessage() |
Modifier and Type | Method and Description |
---|---|
void |
formatTo(java.lang.StringBuilder buffer)
Writes a text representation of this object into the specified
StringBuilder , ideally without allocating
temporary objects. |
java.lang.String |
getFormat()
Returns the object formatted using its toString method.
|
java.lang.String |
getFormattedMessage()
Returns the formatted object message.
|
java.lang.Object |
getParameter()
Returns the object parameter.
|
short |
getParameterCount()
This message does not have any parameters so this method always returns zero.
|
java.lang.Object[] |
getParameters()
Returns the object as if it were a parameter.
|
java.lang.Throwable |
getThrowable()
Gets the message if it is a throwable.
|
Message |
memento()
Returns an immutable snapshot of the current internal state of this reusable message.
|
void |
set(java.lang.Object object) |
java.lang.Object[] |
swapParameters(java.lang.Object[] emptyReplacement)
This message does not have any parameters, so this method returns the specified array.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private transient java.lang.Object obj
private transient java.lang.String objectString
public void set(java.lang.Object object)
public java.lang.String getFormattedMessage()
getFormattedMessage
in interface Message
public void formatTo(java.lang.StringBuilder buffer)
StringBuilderFormattable
StringBuilder
, ideally without allocating
temporary objects.formatTo
in interface StringBuilderFormattable
buffer
- the StringBuilder to write intopublic java.lang.String getFormat()
public java.lang.Object getParameter()
public java.lang.Object[] getParameters()
getParameters
in interface Message
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Throwable getThrowable()
getThrowable
in interface Message
public java.lang.Object[] swapParameters(java.lang.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