package ru.yandex.wmconsole.data.wrappers;

import ru.yandex.wmtools.common.util.XmlDataWrapper;

import java.util.Collection;
import java.util.Map;

/**
 * @author Andrey Mima (amima@yandex-team.ru)
 */
@Deprecated
public class HttpResponseHeadersWrapper extends XmlDataWrapper<Map<String, Collection<String>>> {
    private static final String TAG_ROOT = "headers";
    private static final String TAG_HEADER = "header";
    private static final String ATTR_NAME = "name";
    private static final String ATTR_VALUE = "value";

    public HttpResponseHeadersWrapper(Map<String, Collection<String>> data) {
        super(data, TAG_ROOT);
    }

    @Override
    protected void doToXml(StringBuilder result) {
        for (String name : data.keySet()) {
            for (String value : data.get(name)) {
                putSimpleTag(result, TAG_HEADER, ATTR_NAME, name, ATTR_VALUE, value);
            }
        }
    }
}
