package leigh.elements.sdk.actions;

import java.util.Objects;

/**
 * This action indicates that a message should be displayed to the enduser on the client.
 *
 * @author Alex Leigh
 */
public class MessageAction implements ScreenAction {
    private final String msg;

    public MessageAction(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return "MessageAction{" +
                "msg='" + msg + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MessageAction that = (MessageAction) o;
        return Objects.equals(msg, that.msg);
    }

    @Override
    public int hashCode() {
        return Objects.hash(msg);
    }
}
