package com.atlassian.stash.internal.content;

import com.atlassian.bitbucket.comment.DiffCommentAnchor;
import com.atlassian.bitbucket.content.*;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.List;

/**
 * @since 3.1
 */
public class DiffContentCallbackAdapter implements DiffContentCallback {

    private final DiffContentCallback callback;

    public DiffContentCallbackAdapter(DiffContentCallback callback) {
        this.callback = callback;
    }

    @Override
    public void offerAnchors(@Nonnull List<DiffCommentAnchor> anchors) throws IOException {
        callback.offerAnchors(anchors);
    }

    @Override
    public void onBinary(@Nullable Path src, @Nullable Path dst) throws IOException {
        callback.onBinary(src, dst);
    }

    @Override
    public void onDiffEnd(boolean truncated) throws IOException {
        callback.onDiffEnd(truncated);
    }

    @Override
    public void onDiffStart(@Nullable Path src, @Nullable Path dst) throws IOException {
        callback.onDiffStart(src, dst);
    }

    @Override
    public void onEnd(@Nonnull DiffSummary summary) throws IOException {
        callback.onEnd(summary);
    }

    @Override
    public void onHunkEnd(boolean truncated) throws IOException {
        callback.onHunkEnd(truncated);
    }

    @Override
    public void onHunkStart(int srcLine, int srcSpan, int dstLine, int dstSpan) throws IOException {
        callback.onHunkStart(srcLine, srcSpan, dstLine, dstSpan);
    }

    @Override
    public void onSegmentEnd(boolean truncated) throws IOException {
        callback.onSegmentEnd(truncated);
    }

    @Override
    public void onSegmentLine(@Nonnull String line, @Nullable ConflictMarker marker, boolean truncated) throws IOException {
        callback.onSegmentLine(line, marker, truncated);
    }

    @Override
    public void onSegmentStart(@Nonnull DiffSegmentType type) throws IOException {
        callback.onSegmentStart(type);
    }

    @Override
    public void onStart(@Nonnull DiffContext context) throws IOException {
        callback.onStart(context);
    }
}
