package com.rollbar.payload.utilities;

import com.google.gson.JsonElement;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.rollbar.payload.data.body.TraceChain;

import java.lang.reflect.Type;

public class TraceChainAdapter implements JsonSerializer<TraceChain> {
    public JsonElement serialize(TraceChain traceChain, Type type, JsonSerializationContext jsonSerializationContext) {
        return jsonSerializationContext.serialize(traceChain.traces());
    }
}

@@ -243,78 +243,457 @@
 e;%0A%0A
-public class TraceChainAdapter implements JsonSerializer%3CTraceChain%3E %7B
+/**%0A * The Adapter for Trace Chains. Serializes the whole thing as an array.%0A */%0Apublic class TraceChainAdapter implements JsonSerializer%3CTraceChain%3E %7B%0A    /**%0A     * Serializes a TraceChain as an array of traces.%0A     * @param traceChain the trace chain%0A     * @param type the runtime type of the trace chain%0A     * @param jsonSerializationContext the context doing the serializing%0A     * @return the JsonElement representing the TraceChain%0A     */
 %0A   

Document the TraceChainAdapter