package com.rollbar.payload.data.body;

import com.rollbar.payload.utilities.ArgumentNullException;
import com.rollbar.payload.utilities.Extensible;
import com.rollbar.payload.utilities.Validate;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class Message extends Extensible<Message> implements BodyContents {
    public static final String BODY_KEY = "body";

    @Override
    protected Set<String> getKnownMembers() {
        Set<String> result = new HashSet<String>(4);
        result.add(BODY_KEY);
        return result;
    }

    @Override
    public Message copy() {
        return new Message(members);
    }

    private Message(HashMap<String, Object> members) {
        super(members);
    }

    public Message(String body) throws ArgumentNullException {
        this(body, new HashMap<String, Object>());
    }

    public Message(String body, HashMap<String, Object> members) throws ArgumentNullException {
        super(members);
        Validate.isNotNullOrWhitespace(body, "body");
        this.members.put(BODY_KEY, body);
    }

    public String body() {
        return (String) get(BODY_KEY);
    }

    public Message body(String body) throws ArgumentNullException {
        return new Message(body, members);
    }
}

@@ -265,16 +265,109 @@
 l.Set;%0A%0A
+/**%0A * Represents a message (text) sent to Rollbar, possible with additional information%0A */%0A
 public c
@@ -837,124 +837,492 @@
     
-public Message(String body) throws ArgumentNullException %7B%0A        this(body, new HashMap%3CString, Object%3E());%0A    %7D%0A
+/**%0A     * Constructor%0A     * @param body not nullable, a string to send to Rollbar%0A     * @throws ArgumentNullException if body is null%0A     */%0A    public Message(String body) throws ArgumentNullException %7B%0A        this(body, new HashMap%3CString, Object%3E());%0A    %7D%0A%0A    /**%0A     * Constructor%0A     * @param body not nullable, a string to send to Rollbar%0A     * @param members additional information to send with the message%0A     * @throws ArgumentNullException if body is null%0A     */
 %0A   
@@ -1533,32 +1533,87 @@
 , body);%0A    %7D%0A%0A
+    /**%0A     * @return the text of the message%0A     */%0A
     public Strin
@@ -1665,24 +1665,226 @@
 EY);%0A    %7D%0A%0A
+    /**%0A     * Set body in a copy of this message%0A     * @param body the new body%0A     * @return a copy of this message with body overridden%0A     * @throws ArgumentNullException if body is null%0A     */%0A
     public M

Document Message