package io.rong.messages;

import io.rong.util.GsonUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * 自定义消息
 */
public class CustomTxtMessage extends BaseMessage {
    private String content = "";

    private                        Map<String, String> extra = new HashMap<>();
    private transient static final String              TYPE  = "RC:TxtMsg";

    public CustomTxtMessage(String content, Map<String, String> extra) {
        this.content = content;
        this.extra = extra;
    }

    public String getType() {
        return TYPE;
    }

    /**
     * 获取自定义消息内容。
     *
     * @returnString
     */
    public String getContent() {
        return content;
    }

    /**
     * 设置自定义消息内容。
     *
     * @return
     */
    public void setContent(String content) {
        this.content = content;
    }

    public Map<String, String> getExtra() {
        return extra;
    }

    public void setExtra(Map<String, String> extra) {
        this.extra = extra;
    }

    @Override
    public String toString() {
        return GsonUtil.toJson(this, CustomTxtMessage.class);
    }
}