Class Message

java.lang.Object
net.ssehub.easy.basics.messages.Message
All Implemented Interfaces:
IMessage

public class Message extends Object implements IMessage
Defines a message to be emitted during runtime.
Author:
Holger Eichelberger
  • Field Details

    • description

      private String description
    • status

      private Status status
  • Constructor Details

    • Message

      public Message(String description, Status status)
      Creates a message.
      Parameters:
      description - the message description
      status - the status of the message
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: IMessage
      Returns the message description.
      Specified by:
      getDescription in interface IMessage
      Returns:
      the message description
    • getDetailedDescription

      public String getDetailedDescription()
      Description copied from interface: IMessage
      Returns a detailed message description (if available) or IMessage.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:
      getDetailedDescription in interface IMessage
      Returns:
      the (detailed) message description
    • getStatus

      public Status getStatus()
      Description copied from interface: IMessage
      Returns the status of this message.
      Specified by:
      getStatus in interface IMessage
      Returns:
      the status of this message
    • containsError

      public static boolean containsError(List<Message> messages)
      Utility method returning whether there is an error message in the given messages.
      Parameters:
      messages - the messages (may be null)
      Returns:
      true if there is an error, false else
    • toString

      public static String toString(List<Message> messages, Status filter)
      Utility method returning a string representation of a given set of messages.
      Parameters:
      messages - the messages (may be null)
      filter - just messages of the given status shall be returned (null for all)
      Returns:
      the string representation