package net.kencochrane.raven.marshaller.json;

import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.SentryInterface;

import java.io.IOException;

public interface InterfaceBinding<T extends SentryInterface> {
    void writeInterface(JsonGenerator generator, T sentryInterface) throws IOException;
}

package net.kencochrane.raven.marshaller.json;

import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.SentryInterface;

import java.io.IOException;

/**
 * An interface binding allows to encore a {@link SentryInterface} of a specific type into a JSON stream.
 *
 * @param <T> type of {@link SentryInterface} supported by the binder.
 */
public interface InterfaceBinding<T extends SentryInterface> {
    /**
     * Encodes the content of a sentry interface into a JSON stream.
     *
     * @param generator       JSON generator allowing to write JSON content.
     * @param sentryInterface interface to encode.
     * @throws IOException thrown in case of failure during the generation of JSON content.
     */
    void writeInterface(JsonGenerator generator, T sentryInterface) throws IOException;
}

Document InterfaceBinding