package com.atlassian.stash.internal.scm.git.submodule;

import com.atlassian.bitbucket.content.Submodule;
import com.atlassian.bitbucket.repository.Repository;

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

/**
 * Represents a lazy-evaluated list of remotes for a single repository.
 *
 * @see DefaultGitSubmoduleHelper#getSubmodules(Repository, String, String)
 * @since 2.3
 */
public interface Submodules {

    /**
     * Find a specific submodule in a repository, evaluating the host-specific URLs.
     *
     * @param name      name of the remote file
     * @param contentId the content identifier, which may be used in {@link Submodule#getBrowseUrl()}
     * @return a {@link Submodule} at 'root/name' or {@code null}
     */
    @Nullable
    Submodule getSubmodule(@Nonnull String name, @Nonnull String contentId);
}
