Package org.xwiki.logging
Class Message
- java.lang.Object
-
- org.xwiki.logging.Message
-
- All Implemented Interfaces:
Serializable
,CharSequence
- Direct Known Subclasses:
LogEvent
public class Message extends Object implements Serializable, CharSequence
A translatable message.- Since:
- 7.1M2
- Version:
- $Id: e3828af1658771d95d57333dcbaa0043bb8639f5 $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Message()
Matches anyMessage
.Message(String message)
Message(String message, Object[] argumentArray, Throwable throwable)
Message(String translationKey, String message, Object... arguments)
Message(org.slf4j.Marker marker, String message, Object[] argumentArray, Throwable throwable)
Message(Message message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
charAt(int index)
boolean
equals(Object object)
boolean
equals(String formatedMessage)
Helper to compare the message to the default way of displaying thisMessage
.Object[]
getArgumentArray()
String
getFormattedMessage()
org.slf4j.Marker
getMarker()
String
getMessage()
List<String>
getMessageElements()
Throwable
getThrowable()
String
getTranslationKey()
int
hashCode()
int
length()
CharSequence
subSequence(int start, int end)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
Message
protected Message()
Matches anyMessage
.
-
Message
public Message(String message)
- Parameters:
message
- the message
-
Message
public Message(Message message)
- Parameters:
message
- the message to copy
-
Message
public Message(String message, Object[] argumentArray, Throwable throwable)
- Parameters:
message
- the messageargumentArray
- the event arguments to insert in the messagethrowable
- the throwable associated to the event
-
Message
public Message(String translationKey, String message, Object... arguments)
- Parameters:
translationKey
- the key used to find the translationmessage
- the log messagearguments
- the arguments to insert in the message
-
-
Method Detail
-
getMarker
public org.slf4j.Marker getMarker()
- Returns:
- the log marker
-
getMessage
public String getMessage()
- Returns:
- the log message
-
getArgumentArray
public Object[] getArgumentArray()
- Returns:
- the event arguments to insert in the message
-
getThrowable
public Throwable getThrowable()
- Returns:
- the throwable associated to the event
-
getFormattedMessage
public String getFormattedMessage()
- Returns:
- the formated version of the message
-
getMessageElements
public List<String> getMessageElements()
- Returns:
- the log message cut in peaces
- Since:
- 4.2M1
-
getTranslationKey
public String getTranslationKey()
- Returns:
- the translation key associated to the log
- Since:
- 5.0M2
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
equals
public boolean equals(String formatedMessage)
Helper to compare the message to the default way of displaying thisMessage
.- Parameters:
formatedMessage
- the formatted message- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
-