Package org.apache.logging.log4j.message
Class SimpleMessage
java.lang.Object
org.apache.logging.log4j.message.SimpleMessage
- All Implemented Interfaces:
Serializable,CharSequence,Message,StringBuilderFormattable
public class SimpleMessage
extends Object
implements Message, StringBuilderFormattable, CharSequence
The simplest possible implementation of Message. It just returns the String given as the constructor argument.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasic constructor.SimpleMessage(CharSequence charSequence) Constructor that includes the message.SimpleMessage(String message) Constructor that includes the message. -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) booleanvoidformatTo(StringBuilder buffer) Writes a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.Returns the message.Returns the message.Object[]Returns null since there are no parameters.Always returns null.inthashCode()intlength()private voidsubSequence(int start, int end) toString()private voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
message
-
charSequence
-
-
Constructor Details
-
SimpleMessage
public SimpleMessage()Basic constructor. -
SimpleMessage
Constructor that includes the message.- Parameters:
message- The String message.
-
SimpleMessage
Constructor that includes the message.- Parameters:
charSequence- The CharSequence message.
-
-
Method Details
-
getFormattedMessage
Returns the message.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the message.
-
formatTo
Description copied from interface:StringBuilderFormattableWrites a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.- Specified by:
formatToin interfaceStringBuilderFormattable- Parameters:
buffer- the StringBuilder to write into
-
getFormat
Returns the message. -
getParameters
Returns null since there are no parameters.- Specified by:
getParametersin interfaceMessage- Returns:
- null.
-
equals
-
hashCode
public int hashCode() -
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
getThrowable
Always returns null.- Specified by:
getThrowablein interfaceMessage- Returns:
- null
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-