package ru.yandex.webmaster3.worker.sitetree;

import java.util.List;

/**
 * User: azakharov
 * Date: 12.03.15
 * Time: 16:18
 */
public class YtKeyValueRecord {
    public static void putRecord(StringBuilder sb, String key, List<String> values) {
        sb.append("key=").append(key);
        String tab = "\tvalue=";
        if (values.isEmpty()) {
            sb.append(tab);
        }
        for (String value : values) {
            sb.append(tab);
            sb.append(value);
            tab = "\\t";
        }
        sb.append("\n");
    }

    public static void putRecord(StringBuilder sb, String key, String subKey, List<String> values) {
        sb.append("key=").append(key);
        sb.append("\tsubkey=").append(subKey);
        String tab = "\tvalue=";
        if (values.isEmpty()) {
            sb.append(tab);
        }
        for (String value : values) {
            sb.append(tab);
            sb.append(value);
            tab = "\\t";
        }
        sb.append("\n");
    }
}
