Package org.apache.logging.log4j.message
Class SimpleMessage
- java.lang.Object
-
- org.apache.logging.log4j.message.SimpleMessage
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.CharSequence,Message,org.apache.logging.log4j.util.StringBuilderFormattable
public class SimpleMessage extends java.lang.Object implements Message, org.apache.logging.log4j.util.StringBuilderFormattable, java.lang.CharSequence
The simplest possible implementation of Message. It just returns the String given as the constructor argument.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleMessage()Basic constructor.SimpleMessage(java.lang.CharSequence charSequence)Constructor that includes the message.SimpleMessage(java.lang.String message)Constructor that includes the message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(int index)booleanequals(java.lang.Object o)voidformatTo(java.lang.StringBuilder buffer)java.lang.StringgetFormat()Returns the message.java.lang.StringgetFormattedMessage()Returns the message.java.lang.Object[]getParameters()Returns null since there are no parameters.java.lang.ThrowablegetThrowable()Always returns null.inthashCode()intlength()java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()
-
-
-
Constructor Detail
-
SimpleMessage
public SimpleMessage()
Basic constructor.
-
SimpleMessage
public SimpleMessage(java.lang.String message)
Constructor that includes the message.- Parameters:
message- The String message.
-
SimpleMessage
public SimpleMessage(java.lang.CharSequence charSequence)
Constructor that includes the message.- Parameters:
charSequence- The CharSequence message.
-
-
Method Detail
-
getFormattedMessage
public java.lang.String getFormattedMessage()
Returns the message.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the message.
-
formatTo
public void formatTo(java.lang.StringBuilder buffer)
- Specified by:
formatToin interfaceorg.apache.logging.log4j.util.StringBuilderFormattable
-
getFormat
public java.lang.String getFormat()
Returns the message.
-
getParameters
public java.lang.Object[] getParameters()
Returns null since there are no parameters.- Specified by:
getParametersin interfaceMessage- Returns:
- null.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
getThrowable
public java.lang.Throwable getThrowable()
Always returns null.- Specified by:
getThrowablein interfaceMessage- Returns:
- null
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
-