Share via


UserAllocation Class

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

public class UserAllocation

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 Summary

Constructor Description
UserAllocation()

Creates a new instance of the UserAllocation class.

Method Summary

Modifier and Type Method and Description
List<String> getUsers()

Gets the list of user identifiers that should receive this variant.

String getVariant()

Gets the name of the variant that is assigned to the specified users.

UserAllocation setUsers(List<String> users)

Sets the list of user identifiers that should receive this variant.

UserAllocation setVariant(String variant)

Sets the name of the variant that should be assigned to the specified users.

Methods inherited from java.lang.Object

Constructor Details

UserAllocation

public UserAllocation()

Creates a new instance of the UserAllocation class.

Method Details

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

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

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

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

Applies to