package com.github.bot.curiosone.core.workflow;

import java.util.Objects;

/**
 * Manages a Message.
 * A Message consists of two String: one to store the content of the Message and the other one to
 * store its scope.
 * Provides all the utility methods to create, access and compare a Message.
 */
public class Message {

  /**
   * Stores the content of this Message.
   */
  String message;

  /**
   * Stores the scope of this Message.
   */
  String scope;

  /**
   * Stores the scope of this Message.
   */
  String emotion;

  /**
   * Constructs this Message from a text/content and its scope.
   * @param  message
   *         Message content. Can be null.
   * @param  scope
   *         Message scope. Can be null.
   * @param  emotion
   *         Message emotion. Can be null.
   */
  public Message(String message, String scope, String emotion) {
    this.message = (message == null) ? "" : message;
    this.scope = (scope == null) ? "" : scope;
    this.emotion = (emotion == null) ? "" : emotion;
  }

  /**
   * @return  the content of this Message.
   */
  public String getMessage() {
    return message;
  }

  /**
   * @return  the scope of this Message.
   */
  public String getScope() {
    return scope;
  }

  /**
   * @return  the emotion of this Message.
   */
  public String getEmotion() {
    return emotion;
  }

  /**
   * @return  a String representation of this Message.
   */
  @Override
  public String toString() {
    return message + " (" + scope + ")[" + emotion + "]";
  }

  /**
   * Checks whether this Message equals to the given Object.
   * @param  other
   *         the other Message to be compared against.
   * @return  {@code true} if this Message equals the other Message;
   *          {@code false} otherwise
   */
  @Override
  public boolean equals(Object other) {
    if (other == this) {
      return true;
    }
    if (other == null || other.getClass() != this.getClass()) {
      return false;
    }
    Message that = (Message) other;
    return this.message.equals(that.message)
      && this.scope.equals(that.scope)
      && this.emotion.equals(that.emotion);
  }

  /**
   * Calculates the HashCode of this Message.
   * The HashCode is based on the HashCodes of the Message content and its scope.
   * @return  the HashCode of this Messagess
   */
  @Override
  public int hashCode() {
    return Objects.hash(message, scope, emotion);
  }
}

@@ -1013,32 +1013,71 @@
 ion;%0A  %7D%0A%0A  /**%0A
+   * Gets the content of this Message.%0A
    * @return  th
@@ -1093,33 +1093,32 @@
  of this Message
-.
 %0A   */%0A  public 
@@ -1162,32 +1162,69 @@
 age;%0A  %7D%0A%0A  /**%0A
+   * Gets the scope of this Message.%0A
    * @return  th
@@ -1238,33 +1238,32 @@
  of this Message
-.
 %0A   */%0A  public 
@@ -1303,32 +1303,71 @@
 ope;%0A  %7D%0A%0A  /**%0A
+   * Gets the emotion of this Message.%0A
    * @return  th
@@ -1383,33 +1383,32 @@
  of this Message
-.
 %0A   */%0A  public 
@@ -1456,24 +1456,78 @@
 %0A  %7D%0A%0A  /**%0A
+   * Returns a String representation of this Message.%0A
    * @return
@@ -1559,33 +1559,32 @@
  of this Message
-.
 %0A   */%0A  @Overri

fix Message codestyle errors