package com.atlassian.bitbucket.pull;

import com.atlassian.bitbucket.property.PropertySupport;

import javax.annotation.Nonnull;
import java.util.Collection;

/**
 * Describes whether a pull request can merge and why this is so.
 */
public interface PullRequestMergeability extends PropertySupport {

    /**
     * @return {@code false} if the pull request cannot be merged for any reason; otherwise {@code true}
     */
    boolean canMerge();

    /**
     * @return a collection containing zero or more {@link PullRequestMergeVeto vetoes} from {@code MergeRequestCheck}s
     *         used to validate merge preconditions
     */
    @Nonnull
    Collection<PullRequestMergeVeto> getVetoes();

    /**
     * @return returns true if the pull request has merge conflicts requiring resolution. A pull request with
     * merge conflicts cannot be merged.
     */
    boolean isConflicted();
}
