WeekdayStrategy

data class WeekdayStrategy(val allowedDays: Set<ERROR CLASS: Symbol not found for DayOfWeek>, val timezone: ERROR CLASS: Symbol not found for TimeZone = TimeZone.UTC, clock: ERROR CLASS: Symbol not found for Clock = Clock.System) : FlippingStrategy(source)

A strategy that enables a feature only on specific days of the week.

The feature is enabled when the current day (in the specified timezone) matches one of the allowed days.

This strategy is useful for:

  • Weekday-only features

  • Weekend promotions

  • Scheduled maintenance windows on specific days

See also

for hour-based enabling

for absolute time range enabling

Constructors

Link copied to clipboard
constructor(allowedDays: Set<ERROR CLASS: Symbol not found for DayOfWeek>, timezone: ERROR CLASS: Symbol not found for TimeZone = TimeZone.UTC, clock: ERROR CLASS: Symbol not found for Clock = Clock.System)

Properties

Link copied to clipboard
val allowedDays: Set<ERROR CLASS: Symbol not found for DayOfWeek>

The set of days on which the feature is enabled.

Link copied to clipboard
val timezone: ERROR CLASS: Symbol not found for TimeZone

The timezone used to determine the current day. Defaults to TimeZone.UTC.

Functions

Link copied to clipboard

Combines this strategy with other using logical AND.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
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
open override fun hashCode(): Int
Link copied to clipboard

Negates this strategy.

Link copied to clipboard

Combines this strategy with other using logical OR.