Package net.ssehub.easy.basics.messages
Class Message
- java.lang.Object
-
- net.ssehub.easy.basics.messages.Message
-
- All Implemented Interfaces:
IMessage
- Direct Known Subclasses:
EvaluationVisitor.Message,Message,Message,ValidationMessage
public class Message extends java.lang.Object implements IMessage
Defines a message to be emitted during runtime.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdescriptionprivate Statusstatus
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancontainsError(java.util.List<Message> messages)Utility method returning whether there is an error message in the givenmessages.java.lang.StringgetDescription()Returns the message description.java.lang.StringgetDetailedDescription()Returns a detailed message description (if available) orIMessage.getDescription().StatusgetStatus()Returns the status of this message.static java.lang.StringtoString(java.util.List<Message> messages, Status filter)Utility method returning a string representation of a given set ofmessages.
-
-
-
Field Detail
-
description
private java.lang.String description
-
status
private Status status
-
-
Constructor Detail
-
Message
public Message(java.lang.String description, Status status)Creates a message.- Parameters:
description- the message descriptionstatus- the status of the message
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IMessageReturns the message description.- Specified by:
getDescriptionin interfaceIMessage- Returns:
- the message description
-
getDetailedDescription
public java.lang.String getDetailedDescription()
Description copied from interface:IMessageReturns a detailed message description (if available) orIMessage.getDescription(). Details may e.g., include file position or line number. As e.g. xText cares for location and position itself, this information would be superfluous there, but helpful in a command line context, where this method shall be used instead.- Specified by:
getDetailedDescriptionin interfaceIMessage- Returns:
- the (detailed) message description
-
getStatus
public Status getStatus()
Description copied from interface:IMessageReturns the status of this message.
-
containsError
public static boolean containsError(java.util.List<Message> messages)
Utility method returning whether there is an error message in the givenmessages.- Parameters:
messages- the messages (may be null)- Returns:
trueif there is an error,falseelse
-
toString
public static java.lang.String toString(java.util.List<Message> messages, Status filter)
Utility method returning a string representation of a given set ofmessages.- Parameters:
messages- the messages (may be null)filter- just messages of the given status shall be returned (null for all)- Returns:
- the string representation
-
-