com.comtrade.ecm.engine.objects

## Class EcmMessage

- java.lang.Object
- - com.comtrade.ecm.engine.objects.EcmMessage

- All Implemented Interfaces:
    java.io.Serializable

      public final class EcmMessage
      extends java.lang.Object
      implements java.io.Serializable

  A collection of `EcmMessagePart`s.
  The final result (of a conversion of `EcmMessage` to a String) will be created by concatenation of conversion of its `EcmMessagePart`s.
  A conversion to a String is not performed inside this object. This objects only saves necessary logical information. Conversion is performed in some calling objects, where full information (regarding user's Locale settings) is available.
  There is no need to inherit this class, therefore it is made final.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EcmMessage()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMessages(EcmMessagePart... messageParts)` Adds a collection of `EcmMessagePart`-objects. Skips `null` messages.
    `void` | `clearMessages()` Clears a collection of submessages
    `java.util.List<EcmMessagePart>` | `getMessages()`
    `void` | `setMessages(EcmMessagePart... messageParts)` Sets a collection of `EcmMessagePart`-objects
    `java.lang.String` | `toString()`
    `java.lang.String` | `toString(java.util.Locale locale)`

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

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

- - ### Constructor Detail

    - #### EcmMessage

          public EcmMessage()

  - ### Method Detail

    - #### clearMessages

          public void clearMessages()

      Clears a collection of submessages

    - #### addMessages

          public void addMessages(EcmMessagePart... messageParts)

      Adds a collection of `EcmMessagePart`-objects.
      Skips `null` messages. This is the only method that adds a `EcmMessagePart` to `messages`, so it's a proper place for the validation.
      Parameters:
        `messageParts` - Parts of a message that should be added to a message
      See Also:
        `EcmMessagePart`

    - #### setMessages

          public void setMessages(EcmMessagePart... messageParts)

      Sets a collection of `EcmMessagePart`-objects
      Parameters:
        `messageParts` - An array of messageParts
      See Also:
        `EcmMessagePart`

    - #### getMessages

          public java.util.List<EcmMessagePart> getMessages()

      Returns:
        An ordered collection of `EcmMessagePart`-objects
      See Also:
        `messages`

    - #### toString

          public java.lang.String toString(java.util.Locale locale)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`