Class PercentileAllocation
java.lang.Object
com.azure.spring.cloud.feature.management.models.PercentileAllocation
Percentile allocation of a variant for feature flag targeting. This class defines how users
are assigned to a specific variant based on a percentage range. It allows for gradual rollout
of features to a specific percentage of users by defining a variant name and a numeric range
(from-to) that determines which portion of users receive this variant when the feature is
evaluated.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the PercentileAllocation class. -
Method Summary
Modifier and TypeMethodDescriptiongetFrom()Gets the lower bound of the percentage range for this variant allocation.getTo()Gets the upper bound of the percentage range for this variant allocation.Gets the name of the variant that is assigned to users within the specified percentage range.Sets the lower bound of the percentage range for this variant allocation.Sets the upper bound of the percentage range for this variant allocation.setVariant(String variant) Sets the name of the variant that should be assigned to users within the specified percentage range.
-
Constructor Details
-
PercentileAllocation
public PercentileAllocation()Creates a new instance of the PercentileAllocation class.
-
-
Method Details
-
getVariant
Gets the name of the variant that is assigned to users within the specified percentage range.- Returns:
- the variant name for this percentile allocation
-
setVariant
Sets the name of the variant that should be assigned to users within the specified percentage range. This should match a valid variant name defined in the feature flag configuration.- Parameters:
variant- the variant name to assign for this percentile range- Returns:
- the updated PercentileAllocation instance for method chaining
-
getFrom
Gets the lower bound of the percentage range for this variant allocation. This represents the starting point of the percentile range where users will be assigned to this variant. The value is inclusive and typically between 0.0 and 100.0.- Returns:
- the lower bound percentage value for this allocation
-
setFrom
Sets the lower bound of the percentage range for this variant allocation. This value is inclusive (users with computed hash values greater than or equal to this value will be assigned to this variant). The value should be between 0.0 and 100.0 and less than the 'to' value.- Parameters:
from- the lower bound percentage value to set for this allocation- Returns:
- the updated PercentileAllocation instance for method chaining
-
getTo
Gets the upper bound of the percentage range for this variant allocation.This value is exclusive (users with computed hash values strictly less than this value will be assigned to this variant), except when set to 100, where it becomes inclusive. The value should be between 0.0 and 100.0 and greater than the 'from' value.
- Returns:
- the upper bound percentage value for this allocation
-
setTo
Sets the upper bound of the percentage range for this variant allocation.This value is exclusive (users with computed hash values strictly less than this value will be assigned to this variant), except when set to 100, where it becomes inclusive. The value should be between 0.0 and 100.0 and greater than the 'from' value.
- Parameters:
to- the upper bound percentage value to set for this allocation- Returns:
- the updated PercentileAllocation instance for method chaining
-