package com.atlassian.bitbucket.mesh.git.pull;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * A helper class for interacting with the various refs tracked for a given pull request.
 */
public interface PullRequestRefs {

    /**
     * @return the name of the pull request's "dark" from ref
     */
    @Nonnull
    String getDarkFrom();

    /**
     * @return the name of the pull request's "dark" merge ref
     */
    @Nonnull
    String getDarkMerge();

    /**
     * @return the name of the pull request's public from ref
     */
    @Nonnull
    String getPublicFrom();

    /**
     * @return the name of the pull request's public merge ref
     */
    @Nonnull
    String getPublicMerge();

    /**
     * @return {@code true} if the {@link #resolveDarkFrom "dark" from ref} doesn't match the pull request's
     *         current from ref; otherwise, {@code false} if it does
     */
    boolean isDarkFromOutdated();

    /**
     * @return {@code true} if the {@link #resolvePublicFrom public from ref} doesn't match the pull request's
     *         current from ref; otherwise, {@code false} if it does
     */
    boolean isPublicFromOutdated();

    /**
     * @return the resolved {@link #getDarkFrom "dark" from ref}, which may be {@code null} if the ref hasn't
     *         been created yet
     */
    @Nullable
    String resolveDarkFrom();

    /**
     * @return the resolved {@link #getDarkMerge "dark" merge ref}, which may be {@code null} if the ref hasn't
     *         been created yet
     */
    @Nullable
    String resolveDarkMerge();

    /**
     * @return the resolved {@link #getPublicFrom public from ref}, which may be {@code null} if the ref hasn't
     *         been created yet
     */
    @Nullable
    String resolvePublicFrom();

    /**
     * @return the resolved {@link #getPublicMerge public merge ref}, which may be {@code null} if the ref hasn't
     *         been created yet
     */
    @Nullable
    String resolvePublicMerge();
}
