madkit.message

## Class MapMessage<K,V>

- java.lang.Object
- - madkit.kernel.Message
  - - madkit.message.ObjectMessage<java.util.Map<K,V>>
    - - madkit.message.MapMessage<K,V>

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

      public class MapMessage<K,V>
      extends ObjectMessage<java.util.Map<K,V>>

  This class could be used to build message conveying `Map` objects between MaDKit agents.
  Since:
    MaDKit 5.1.2
  Version:
    0.9
  Author:
    Fabien Michel
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapMessage()` /** Builds a `MapMessage` containing an empty `HashMap`}
    `MapMessage(java.util.Map<K,V> map)` Builds a `MapMessage` containing the specified map

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `get(K key)` invoke `Map.get(Object)` on the map contained in this message
    `V` | `put(K key, V value)` invoke `Map.put(Object, Object)` on the map contained in this message.

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

      `getContent, max, min, sort, toString`

    - ### 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

    - #### MapMessage

          public MapMessage(java.util.Map<K,V> map)

      Builds a `MapMessage` containing the specified map
      Parameters:
        `map` - the original map

    - #### MapMessage

          public MapMessage()

      /** Builds a `MapMessage` containing an empty `HashMap`}

  - ### Method Detail

    - #### put

          public V put(K key,
                       V value)

      invoke `Map.put(Object, Object)` on the map contained in this message.
      Parameters:
        `key` - key with which the specified value is to be associated
        `value` - value to be associated with the specified key
      Returns:
        the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`, if the implementation supports `null` values.)
      See Also:
        `Map`

    - #### get

          public V get(K key)

      invoke `Map.get(Object)` on the map contained in this message

Fabien Michel, Olivier Gutknecht, Jacques Ferber - September 9 2019