AllowListStrategy

@Serializable
@SerialName(value = "allowList")
data class AllowListStrategy(val allowedList: Set<String>) : FlippingStrategy(source)

A strategy that enables a feature only for users in an allowed list.

Requires ContextKeys.USER_ID to be set in the FlippingExecutionContext. Throws IllegalStateException if no user ID is present. Returns false if the list is empty.

Throws

if ContextKeys.USER_ID is not present in the context

Constructors

Link copied to clipboard
constructor(allowedList: Set<String>)

Properties

Link copied to clipboard

The set of user IDs for whom the feature is enabled.

Functions

Link copied to clipboard

Combines this strategy with other using logical AND.

Link copied to clipboard
open suspend override fun evaluate(featureId: String, store: FeatureStore?, context: FlippingExecutionContext): Boolean

Evaluates whether the feature should be enabled based on the execution context.

Link copied to clipboard

Negates this strategy.

Link copied to clipboard

Combines this strategy with other using logical OR.