Package org.apache.logging.log4j.message
Class SimpleMessage
java.lang.Object
org.apache.logging.log4j.message.SimpleMessage
- All Implemented Interfaces:
Serializable
,CharSequence
,Message
,org.apache.logging.log4j.util.StringBuilderFormattable
public class SimpleMessage
extends Object
implements Message, org.apache.logging.log4j.util.StringBuilderFormattable, CharSequence
The simplest possible implementation of Message. It just returns the String given as the constructor argument.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBasic constructor.SimpleMessage
(CharSequence charSequence) Constructor that includes the message.SimpleMessage
(String message) Constructor that includes the message. -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) boolean
void
formatTo
(StringBuilder buffer) Returns the message.Returns the message.Object[]
Returns null since there are no parameters.Always returns null.int
hashCode()
int
length()
subSequence
(int start, int end) toString()
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
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:
getFormattedMessage
in interfaceMessage
- Returns:
- the message.
-
formatTo
- Specified by:
formatTo
in interfaceorg.apache.logging.log4j.util.StringBuilderFormattable
-
getFormat
Returns the message. -
getParameters
Returns null since there are no parameters.- Specified by:
getParameters
in interfaceMessage
- Returns:
- null.
-
equals
-
hashCode
public int hashCode() -
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
getThrowable
Always returns null.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- null
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-