package com.atlassian.bitbucket.repository.ref.restriction;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;

/**
 * A registry, which enumerates all available {@link RefMatcherProvider}s
 */
public interface RefMatcherProviderRegistry {

    /**
     * Gets a {@link RefMatcherProvider} by its ID.
     *
     * @param id the {@link RefMatcherType#getId ID} for the {@link RefMatcherType type} of {@link RefMatcherProvider provider} to retrieve
     * @return ahe {@link RefMatcherProvider} with the specified ID,
     *  or {@code null} if no {@link RefMatcherProvider} with the specified ID could be found
     */
    @Nullable
    RefMatcherProvider getProvider(@Nonnull String id);

    /**
     * @return a {@code List<RefMatcherProvider>} of all the available {@link RefMatcherProvider providers}
     */
    @Nonnull
    List<RefMatcherProvider> getProviders();
}
