Interface ExperimentFeatures

All Known Implementing Classes:
ConfigExperimentFeatures

public interface ExperimentFeatures
Features that can be enabled/disabled on Gerrit (e. g. experiments to research new behavior in the current release).

It may depend on the implementation if the result is decided on the per-request basis or not, so the outcomes should not be persisted in Singleton.

  • Method Details

    • isFeatureEnabled

      boolean isFeatureEnabled(String featureFlag)
      Given the name of the feature, returns if it is enabled on the Gerrit server.

      Depending on the implementation, it can be more efficient than filtering the results of getEnabledExperimentFeatures().

      Parameters:
      featureFlag - the name of the feature to test.
      Returns:
      if the feature is enabled.
    • isFeatureEnabled

      boolean isFeatureEnabled(String featureFlag, Project.NameKey project)
      Same isFeatureEnabled(java.lang.String), but takes into account project, when evaluating the experiment.
    • getEnabledExperimentFeatures

      com.google.common.collect.ImmutableSet<String> getEnabledExperimentFeatures()
      Returns the names of the features that are enabled on Gerrit instance (either by default or via gerrit.config).