Class UserAllocation

java.lang.Object
com.azure.spring.cloud.feature.management.models.UserAllocation

public class UserAllocation extends Object
User allocation of a variant for feature flag targeting. This class defines how specific users are assigned to a particular variant of a feature. It contains a reference to a variant name and a list of user identifiers that should receive this variant when the feature flag is evaluated. This enables targeted feature rollout to specific users.
  • Constructor Details

    • UserAllocation

      public UserAllocation()
      Creates a new instance of the UserAllocation class.
  • Method Details

    • getVariant

      public String getVariant()
      Gets the name of the variant that is assigned to the specified users.
      Returns:
      the variant name for this user allocation
    • setVariant

      public UserAllocation setVariant(String variant)
      Sets the name of the variant that should be assigned to the specified users. This should match a valid variant name defined in the feature flag configuration.
      Parameters:
      variant - the variant name to assign to the users
      Returns:
      the updated UserAllocation object
    • getUsers

      public List<String> getUsers()
      Gets the list of user identifiers that should receive this variant. These identifiers are typically usernames, email addresses, or user IDs that uniquely identify users in the system.
      Returns:
      the list of user identifiers for this allocation
    • setUsers

      public UserAllocation setUsers(List<String> users)
      Sets the list of user identifiers that should receive this variant. When a user matches any of these identifiers, they will be assigned this variant during feature flag evaluation.
      Parameters:
      users - the list of user identifiers to associate with this variant
      Returns:
      the updated UserAllocation object