com.dlsc.flexgantt.swing

## Class Message

- java.lang.Object
- - com.dlsc.flexgantt.swing.Message

- All Implemented Interfaces:
    IMessage
  Direct Known Subclasses:
    RelationshipMessage, TimelineObjectPathMessage, TreePathMessage

      public class Message
      extends Object
      implements IMessage

  The default implementation of the `IMessage` interface. Objects of this type can contain general information, warnings, or errors. Whether a message is either one can be determined by checking the message type ID.
  Since:
    1.0
  Version:
    $Revision: 1.4 $
  Author:
    Dirk Lemmermann
  See Also:
    `TimelineObjectPathMessage`, `TreePathMessage`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Message(MessageTypeId id, String text)` Constructs a new message.
    `Message(MessageTypeId id, String text, Date time)` Constructs a new message.
    `Message(MessageTypeId id, String text, Object details)` Constructs a new message.
    `Message(MessageTypeId id, String text, Object details, Date time)` Constructs a new message.
    `Message(String text)` Constructs a new information message.
    `Message(String text, Object details)` Constructs a new error message with some details attached to it.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getMessageDetails()` Returns an object that contains some more details about the message.
    `String` | `getMessageText()` Returns the text that will be displayed to the user.
    `Date` | `getMessageTime()` Returns the time stamp when the message occured.
    `MessageTypeId` | `getMessageTypeId()` Returns the type of the message (information, warning, error).
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Message

          public Message(MessageTypeId id,
                         String text,
                         Object details,
                         Date time)

      Constructs a new message.
      Parameters:
        `id` - a message type identifier used to distinguish between plain information messages or warning and error messages
        `text` - the message that will be shown to the user
        `details` - an object storing additional information about the cause of the message
        `time` - a message time stamp
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

    - #### Message

          public Message(MessageTypeId id,
                         String text,
                         Date time)

      Constructs a new message. The message does not carry any detailed information.
      Parameters:
        `id` - a message type identifier used to distinguish between plain information messages or warning and error messages
        `text` - the message that will be shown to the user
        `time` - a message time stamp
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

    - #### Message

          public Message(MessageTypeId id,
                         String text,
                         Object details)

      Constructs a new message.
      Parameters:
        `id` - a message type identifier used to distinguish between plain information messages or warning and error messages
        `text` - the message that will be shown to the user
        `details` - an object storing additional information about the cause of the message
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

    - #### Message

          public Message(MessageTypeId id,
                         String text)

      Constructs a new message.
      Parameters:
        `id` - a message type identifier used to distinguish between plain information messages or warning and error messages
        `text` - the message that will be shown to the user
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

    - #### Message

          public Message(String text,
                         Object details)

      Constructs a new error message with some details attached to it.
      Parameters:
        `text` - the message that will be shown to the user
        `details` - an object storing additional information about the cause of the message
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

    - #### Message

          public Message(String text)

      Constructs a new information message.
      Parameters:
        `text` - the message that will be shown to the user
      Since:
        1.0
      See Also:
        `TreePathMessage`, `TimelineObjectPathMessage`

  - ### Method Detail

    - #### getMessageTypeId

          public MessageTypeId getMessageTypeId()

      Description copied from interface: `IMessage`
      Returns the type of the message (information, warning, error).
      Specified by:
        `getMessageTypeId` in interface `IMessage`
      Returns:
        the message type

    - #### getMessageText

          public String getMessageText()

      Description copied from interface: `IMessage`
      Returns the text that will be displayed to the user.
      Specified by:
        `getMessageText` in interface `IMessage`
      Returns:
        the text of the message

    - #### getMessageDetails

          public Object getMessageDetails()

      Description copied from interface: `IMessage`
      Returns an object that contains some more details about the message. This could for example be a `Throwable`. The return type is this generic in order to support different kinds of detailed information in the future that can not be foreseen, yet.
      Specified by:
        `getMessageDetails` in interface `IMessage`
      Returns:
        detailed information about the message

    - #### getMessageTime

          public Date getMessageTime()

      Description copied from interface: `IMessage`
      Returns the time stamp when the message occured.
      Specified by:
        `getMessageTime` in interface `IMessage`
      Returns:
        the message's time stamp

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.