Class FeatureDefinition
java.lang.Object
com.azure.spring.cloud.feature.management.models.FeatureDefinition
This class represents a complete feature flag definition including its identity,
description, enabled state, conditions for evaluation, variant allocation,
and variant references for feature flags that support multiple variations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the allocation strategy for this feature flag when using variants.Gets the set of conditions that determine when this feature flag should be enabled.Gets the human-readable description of this feature flag.getId()Gets the unique identifier of this feature flag.Gets the telemetry configuration for this feature flag.Gets the list of variant references that define the different variations of this feature flag.booleanDetermines whether this feature flag is enabled by default.setAllocation(Allocation allocation) Sets the allocation strategy for this feature flag when using variants.setConditions(Conditions conditions) Sets the conditions that determine when this feature flag should be enabled.setDescription(String description) Sets the human-readable description of this feature flag.setEnabled(boolean enabled) Sets whether this feature flag is enabled by default.Sets the unique identifier of this feature flag.setTelemetry(FeatureTelemetry telemetry) Sets the telemetry configuration for this feature flag.setVariants(List<VariantReference> variants) Sets the list of variant references that define the different variations of this feature flag.
-
Constructor Details
-
FeatureDefinition
public FeatureDefinition()Creates a new instance of the Feature class.
-
-
Method Details
-
getId
Gets the unique identifier of this feature flag.- Returns:
- the feature flag's identifier
-
setId
Sets the unique identifier of this feature flag.- Parameters:
id- the feature flag identifier to set- Returns:
- the updated Feature instance for method chaining
-
isEnabled
public boolean isEnabled()Determines whether this feature flag is enabled by default. Even when enabled, the flag may still be controlled by conditions and filters.- Returns:
- true if the feature flag is enabled, false otherwise
-
setEnabled
Sets whether this feature flag is enabled by default.- Parameters:
enabled- true to enable the feature flag, false to disable it- Returns:
- the updated Feature instance for method chaining
-
getDescription
Gets the human-readable description of this feature flag.- Returns:
- the description of the feature flag
-
setDescription
Sets the human-readable description of this feature flag. This provides context about what the feature flag controls.- Parameters:
description- the description to set for the feature flag- Returns:
- the updated Feature instance for method chaining
-
getConditions
Gets the set of conditions that determine when this feature flag should be enabled. The conditions contain feature filters and their evaluation logic.- Returns:
- the conditions for feature flag evaluation
-
setConditions
Sets the conditions that determine when this feature flag should be enabled. These conditions define the feature filters and logic for evaluating whether the feature should be enabled for a specific request.- Parameters:
conditions- the conditions to set for feature flag evaluation- Returns:
- the updated Feature instance for method chaining
-
getAllocation
Gets the allocation strategy for this feature flag when using variants. The allocation defines how users or requests are assigned to specific variants through mechanisms like user targeting, percentile rollout, or group assignment.- Returns:
- the allocation strategy for variant assignment
-
setAllocation
Sets the allocation strategy for this feature flag when using variants. The allocation controls how users or requests are assigned to specific variants through user targeting, percentile rollout, or group assignment.- Parameters:
allocation- the allocation strategy to set for variant assignment- Returns:
- the updated Feature instance for method chaining
-
getVariants
Gets the list of variant references that define the different variations of this feature flag. These variants represent different implementations or configurations that can be assigned to users when the feature is enabled.- Returns:
- the list of variant references for this feature flag
-
setVariants
Sets the list of variant references that define the different variations of this feature flag. These variants represent different implementations or configurations that can be dynamically assigned when the feature is enabled.- Parameters:
variants- the list of variant references to set for this feature flag- Returns:
- the updated Feature instance for method chaining
-
getTelemetry
Gets the telemetry configuration for this feature flag. The telemetry configuration controls whether events related to this feature flag should be logged and what additional metadata should be included.- Returns:
- the telemetry configuration for this feature flag
-
setTelemetry
Sets the telemetry configuration for this feature flag. This controls whether events related to this feature flag should be logged and what additional metadata should be included.- Parameters:
telemetry- the telemetry configuration to set for this feature flag- Returns:
- the updated Feature instance for method chaining
-