Class FeatureManager

java.lang.Object
com.azure.spring.cloud.feature.management.FeatureManager

public class FeatureManager extends Object
Used to evaluate the enabled state of a feature and/or get the assigned variant of a feature, if any.
  • Method Details

    • isEnabledAsync

      public Mono<Boolean> isEnabledAsync(String feature)
      Checks to see if the feature is enabled. If enabled it check each filter, once a single filter returns true it returns true. If no filter returns true, it returns false. If there are no filters, it returns true. If feature isn't found it returns false.
      Parameters:
      feature - Feature being checked.
      Returns:
      state of the feature
      Throws:
      FilterNotFoundException - file not found
    • isEnabled

      public Boolean isEnabled(String feature) throws FilterNotFoundException
      Checks to see if the feature is enabled. If enabled it check each filter, once a single filter returns true it returns true. If no filter returns true, it returns false. If there are no filters, it returns true. If feature isn't found it returns false.
      Parameters:
      feature - Feature being checked.
      Returns:
      state of the feature
      Throws:
      FilterNotFoundException - file not found
    • isEnabledAsync

      public Mono<Boolean> isEnabledAsync(String feature, Object featureContext)
      Checks to see if the feature is enabled. If enabled it check each filter, once a single filter returns true it returns true. If no filter returns true, it returns false. If there are no filters, it returns true. If feature isn't found it returns false.
      Parameters:
      feature - Feature being checked.
      featureContext - Local context
      Returns:
      state of the feature
      Throws:
      FilterNotFoundException - file not found
    • isEnabled

      public Boolean isEnabled(String feature, Object featureContext) throws FilterNotFoundException
      Checks to see if the feature is enabled. If enabled it check each filter, once a single filter returns true it returns true. If no filter returns true, it returns false. If there are no filters, it returns true. If feature isn't found it returns false.
      Parameters:
      feature - Feature being checked.
      featureContext - Local context
      Returns:
      state of the feature
      Throws:
      FilterNotFoundException - file not found
    • getVariant

      public Variant getVariant(String feature)
      Returns the variant assigned to the current context.
      Parameters:
      feature - Feature being checked.
      Returns:
      Assigned Variant
    • getVariant

      public Variant getVariant(String feature, Object featureContext)
      Returns the variant assigned to the current context.
      Parameters:
      feature - Feature being checked.
      featureContext - Local context
      Returns:
      Assigned Variant
    • getVariantAsync

      public Mono<Variant> getVariantAsync(String feature)
      Returns the variant assigned to the current context.
      Parameters:
      feature - Feature being checked.
      Returns:
      Assigned Variant
    • getVariantAsync

      public Mono<Variant> getVariantAsync(String feature, Object featureContext)
      Returns the variant assigned to the current context.
      Parameters:
      feature - Feature being checked.
      featureContext - Local context
      Returns:
      Assigned Variant
    • getAllFeatureNames

      public Set<String> getAllFeatureNames()
      Returns the names of all features flags
      Returns:
      a set of all feature names