package com.atlassian.bitbucket.internal.branch.model.configuration;

import javax.annotation.Nullable;

/**
 * Represents configuration of a single significant branch in the branch model. The configuration consists of a boolean
 * flag specifying whether to use the default branch, or else a concrete ref ID to identify the branch to use.
 *
 * @since 2.8
 */
public interface BranchConfiguration {

    /**
     * The ref ID of the branch.
     *
     * @return ref ID, may be {@code null}, in which case {@link #isUseDefault()}
     * should return {@code true}.
     */
    @Nullable
    String getRefId();

    /**
     * A flag specifying whether the default repository branch should be used as this branch.
     *
     * @return {@code true}, if the current default repository branch should be used, {@code false} otherwise,
     * in which case {@link #getRefId()} should return a non-empty ref ID.
     */
    boolean isUseDefault();
}
