Interface FeatureManager


public interface FeatureManager
Provides access to bitbucket.properties flags for enabling/disabling various features.
Since:
4.1
  • Method Details

    • isDisabled

      boolean isDisabled(@Nonnull Feature feature)
      Parameters:
      feature - the feature to check
      Returns:
      true if the feature is disabled, otherwise false
      Since:
      8.13
    • isDisabled

      boolean isDisabled(@Nonnull Feature feature, boolean defaultValue)
      Parameters:
      feature - the feature to check
      defaultValue - the value to return if no property has been defined for the feature
      Returns:
      true if the feature is disabled, defaultValue if no property has been defined for the feature, otherwise false.
      Since:
      8.13
    • isEnabled

      boolean isEnabled(@Nonnull Feature feature)
      Parameters:
      feature - the feature to check
      Returns:
      true if the feature is enabled, otherwise false
    • isEnabled

      boolean isEnabled(@Nonnull Feature feature, boolean defaultValue)
      Parameters:
      feature - the feature to check
      defaultValue - the value to return if no property has been defined for the feature
      Returns:
      true if the feature is enabled, defaultValue if no property has been defined for the feature, otherwise false.
    • requireEnabled

      void requireEnabled(@Nonnull Feature feature)
      Ensures that Feature is enabled.

      If there is no property for the Feature then it is assumed to be disabled.

      Parameters:
      feature - the Feature to check
      Throws:
      FeatureDisabledException - in case if Feature is disabled
      Since:
      6.5
    • requireEnabled

      void requireEnabled(@Nonnull Feature feature, boolean defaultValue)
      Ensures that Feature is enabled.

      If there is no property for the Feature then the defaultValue will be used for whether the feature is enabled.

      Parameters:
      feature - the Feature to check
      defaultValue - whether the feature is enabled if no property has been defined for the feature
      Throws:
      FeatureDisabledException - in case if Feature is disabled
      Since:
      6.5