madkit.message.hook

## Class MessageEvent

- java.lang.Object
- - madkit.kernel.Message
  - - madkit.message.ObjectMessage<HookMessage.AgentActionEvent>
    - - madkit.message.hook.HookMessage
      - - madkit.message.hook.CGREvent
        - - madkit.message.hook.MessageEvent

- All Implemented Interfaces:
    Serializable, Cloneable

      public class MessageEvent
      extends CGREvent

  A message which is sent to agents that have requested a hook on `HookMessage.AgentActionEvent.AGENT_STARTED` or `HookMessage.AgentActionEvent.AGENT_TERMINATED`
  Since:
    MadKit 5.0.0.21
  Version:
    0.9
  Author:
    Fabien Michel
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class madkit.message.hook.HookMessage

      `HookMessage.AgentActionEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageEvent(HookMessage.AgentActionEvent agentAction, Message m)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Message` | `getMessage()`
    `AgentAddress` | `getSourceAgent()` Returns the address of the agent that did the request.
    `String` | `toString()`

    - ### Methods inherited from class madkit.message.ObjectMessage

      `getContent, max, min, sort`

    - ### Methods inherited from class madkit.kernel.Message

      `clone, getConversationID, getReceiver, getSender`

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

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

- - ### Constructor Detail

    - #### MessageEvent

          public MessageEvent(HookMessage.AgentActionEvent agentAction,
                              Message m)

  - ### Method Detail

    - #### getMessage

          public Message getMessage()

      Returns:
        the exchanged message

    - #### getSourceAgent

          public AgentAddress getSourceAgent()

      Description copied from class: `CGREvent`
      Returns the address of the agent that did the request.
      Specified by:
        `getSourceAgent` in class `CGREvent`
      Returns:
        the name of the agent that triggers the event

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `CGREvent`
      See Also:
        `Message.toString()`

Fabien Michel, Olivier Gutknecht, Jacques Ferber - February 17 2020