package com.mortals.xhx.common.model;

import com.mortals.xhx.queue.TbQueueMsgHeaders;

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

/**
 * 默认消息头
 *
 * @author: zxfei
 * @date: 2021/11/22 11:14
 */
public class DefaultTbQueueMsgHeaders implements TbQueueMsgHeaders {

    protected final Map<String, byte[]> data = new HashMap<>();

    public DefaultTbQueueMsgHeaders() {
        data.put(MessageHeader.TOPIC, new byte[]{});
        data.put(MessageHeader.QOS, new byte[]{(byte) 0});

    }

    @Override
    public byte[] put(String key, byte[] value) {
        return data.put(key, value);
    }

    @Override
    public byte[] get(String key) {
        return data.get(key);
    }

    @Override
    public Map<String, byte[]> getData() {
        return data;
    }
}
