package com.ym.mec.im.message;

import com.ym.mec.im.BaseMessage;
import com.ym.pojo.CustomMessage;
import org.apache.commons.lang3.StringUtils;

public class MetronomeMessageMessage extends BaseMessage {
    private CustomMessage content;
    private static final transient String TYPE = "DY:PlayMidiMessage";

    public MetronomeMessageMessage(CustomMessage content) {
        this.content = content;
    }

    public CustomMessage getContent() {
        return content;
    }

    public void setContent(CustomMessage content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "{\"enable\":" + content.getEnable() +
                ", \"customType\":" + content.getCustomType() +
                ", \"rate\":" + content.getRate() +
                ", \"playVolume\":" + content.getPlayVolume() +
                ", \"userId\":" + (StringUtils.isEmpty(content.getUserId())?"\"\"":"\"" + content.getUserId() + "\"") +
                '}';
    }

    @Override
    public String getObjectName() {
        return TYPE;
    }
}
