package com.atlassian.bitbucket.scm.git.command.merge.conflict;

import com.atlassian.bitbucket.content.ChangeType;

import javax.annotation.Nonnull;

public class ContentGitMergeConflict extends AbstractPathGitMergeConflict {

    private final boolean binary;

    /**
     * @deprecated in 3.11 for removal in 4.0. Use {@link #ContentGitMergeConflict(String, String, boolean)} instead.
     */
    @Deprecated
    @SuppressWarnings("unused") // Backward API compatibility
    public ContentGitMergeConflict(@Nonnull String message, @Nonnull String path) {
        this(message, path, false);
    }

    public ContentGitMergeConflict(@Nonnull String message, @Nonnull String path, boolean binary) {
        super(GitMergeConflictType.CONTENT, message, ChangeType.MODIFY, path);
        this.binary = binary;
    }

    @Override
    public void accept(@Nonnull GitMergeConflictVisitor visitor) {
        visitor.visit(this);
    }

    public boolean isBinary() {
        return binary;
    }
}
