Class Message


  • public class Message
    extends java.lang.Object
    Represents a message, commonly an error message.

    Description

    Each message has a string, but it also has information about which object generated the message and the severity of the message.

    Lifecycle

    This is a lightweight data object. The object is usually inserted into a MessageSet.

    Properties

    Property name Type Description
    data Object Additional message data that is specific to this message.
    object Object The object that generated the message.
    message String The message string.
    severity int The severity level of the message.
    • Constructor Summary

      Constructors 
      Constructor Description
      Message​(java.lang.Object object, java.lang.String short_message, java.lang.String long_message, int severity)
      Creates a message.
      Message​(java.lang.Object object, java.lang.String short_message, java.lang.String long_message, int severity, java.lang.Object data)
      Creates a message.
      Message​(java.lang.String message)
      Creates a message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getData()
      Get the user data.
      java.lang.String getLongMessage()
      Get the long message.
      java.lang.Object getObject()
      Get the object.
      int getSeverity()
      Get the severity.
      java.lang.String getShortMessage()
      Get the short message.
      void setData​(java.lang.Object data)
      Set the user data.
      void setLongMessage​(java.lang.String long_message)
      Set the long message.
      void setObject​(java.lang.Object object)
      Set the object.
      void setSeverity​(int severity)
      Set the severity.
      void setShortMessage​(java.lang.String short_message)
      Set the short message.
      java.lang.String toLongString()
      Get the long message string.
      java.lang.String toShortString()
      Get the short message string.
      java.lang.String toString()
      Get the short message string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Message

        public Message​(java.lang.String message)
        Creates a message. Sets long and short message to the same thing. Sets object and data to null and sets severity to INFO.
        Throws:
        java.lang.NullPointerException - If message is null.
      • Message

        public Message​(java.lang.Object object,
                       java.lang.String short_message,
                       java.lang.String long_message,
                       int severity)
        Creates a message. object can be null. Sets data to null.
        Throws:
        java.lang.NullPointerException - If short_message is null.
      • Message

        public Message​(java.lang.Object object,
                       java.lang.String short_message,
                       java.lang.String long_message,
                       int severity,
                       java.lang.Object data)
        Creates a message. object and data can be null.
        Throws:
        java.lang.NullPointerException - If short_message is null.
    • Method Detail

      • getObject

        public java.lang.Object getObject()
        Get the object.
      • setObject

        public void setObject​(java.lang.Object object)
        Set the object.
      • getShortMessage

        public java.lang.String getShortMessage()
        Get the short message.
      • setShortMessage

        public void setShortMessage​(java.lang.String short_message)
        Set the short message.
        Throws:
        java.lang.NullPointerException - If short_message is null.
      • getLongMessage

        public java.lang.String getLongMessage()
        Get the long message.
      • setLongMessage

        public void setLongMessage​(java.lang.String long_message)
        Set the long message.
        Throws:
        java.lang.NullPointerException - If long_message is null.
      • getSeverity

        public int getSeverity()
        Get the severity.
      • setSeverity

        public void setSeverity​(int severity)
        Set the severity.
      • getData

        public java.lang.Object getData()
        Get the user data.
      • setData

        public void setData​(java.lang.Object data)
        Set the user data.
      • toString

        public java.lang.String toString()
        Get the short message string.
        Overrides:
        toString in class java.lang.Object
      • toShortString

        public java.lang.String toShortString()
        Get the short message string.
      • toLongString

        public java.lang.String toLongString()
        Get the long message string.