package com.atlassian.stash.internal.discovery;

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

/**
 * A service for handling feature discovery
 *
 * @since 4.8
 */
public interface FeatureDiscoveryService {

    /**
     * Checks the provided {@link DiscoverableFeature features} and returns those which so far have not been discovered
     * by the currently logged in user
     *
     * @param features the features to check for
     * @return the {@link DiscoverableFeature features} from the provided set which have not been discovered
     * by the currently logged in user so far
     */
    @Nonnull
    Set<DiscoverableFeature> getIfUndiscovered(@Nonnull Set<DiscoverableFeature> features);

    /**
     * Checks all the existing {@link DiscoverableFeature features} and returns those which so far
     * have not been discovered by the currently logged in user
     *
     * @return the set of {@link DiscoverableFeature features} which have not been discovered
     * by the currently logged in user so far
     */
    @Nonnull
    Set<DiscoverableFeature> getUndiscovered();

    /**
     * Mark the provided {@link DiscoverableFeature features} as discovered by the currently logged in user
     *
     * @param features the set of features to mark as discovered
     */
    void setDiscovered(@Nonnull Set<DiscoverableFeature> features);
}
