/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.fasterxml.jackson.core.JsonGenerationException
 *  com.fasterxml.jackson.core.JsonGenerator
 *  com.fasterxml.jackson.databind.SerializerProvider
 *  com.fasterxml.jackson.databind.ser.std.StdSerializer
 */
package org.apache.logging.log4j.core.jackson;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
import org.apache.logging.log4j.core.jackson.MapEntry;

public class ListOfMapEntrySerializer
extends StdSerializer<Map> {
    protected ListOfMapEntrySerializer() {
        super(Map.class);
    }

    public void serialize(Map map, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException {
        Set entrySet = map.entrySet();
        MapEntry[] pairs = new MapEntry[entrySet.size()];
        int i = 0;
        for (Map.Entry entry : entrySet) {
            pairs[i++] = new MapEntry((String)entry.getKey(), (String)entry.getValue());
        }
        jgen.writeObject((Object)pairs);
    }
}
