public class StringMessage extends Object implements CharSequence, Writable
Useful for delayed serialization of arguments for logging.
Message string will not be constructed until the toString()
method is called.
Constructor and Description |
---|
StringMessage(String pattern,
Object... args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
MediaType |
getMediaType()
Returns the serialized media type for this resource (e.g.
|
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
Writer |
writeTo(Writer w)
Serialize this object to the specified writer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public StringMessage(String pattern, Object... args)
pattern
- MessageFormat
-style pattern.args
- Message arguments.public Writer writeTo(Writer w) throws IOException
Writable
writeTo
in interface Writable
w
- The writer to write to.IOException
public MediaType getMediaType()
Writable
getMediaType
in interface Writable
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
Copyright © 2018 Apache. All rights reserved.