package com.dbs.mplus.fatima.framework.processor.msg;

import com.dbs.mplus.fatima.framework.MPlusFrameworkConstants;

import java.util.Map;

/**
 * 명령 메시지
 * Created by aple on 2015. 7. 27..
 */
public class CommandMessage implements Message {
    private final MPlusFrameworkConstants.MSG_FUNCTION_TYPE function;
    private final Map<String, String> valueMap;

    /**
     * 생성자
     * @param function
     * @param valueMap
     */
    public CommandMessage(MPlusFrameworkConstants.MSG_FUNCTION_TYPE function, Map<String, String> valueMap) {
        this.function = function;
        this.valueMap = valueMap;
    }

    @Override
    public MPlusFrameworkConstants.MSG_TYPE getType() {
        return MPlusFrameworkConstants.MSG_TYPE.COMMAND;
    }

    @Override
    public MPlusFrameworkConstants.MSG_FUNCTION_TYPE getFunction() {
        return this.function;
    }

    @Override
    public Map<String, String> getValueMap() {
        return this.valueMap;
    }

    @Override
    public String toString() {
        return "CommandMessage{" +
                "function : " + function +
                ", valueMap : " + valueMap +
                '}';
    }
}
