FeatureType

Represents the type classification of a feature flag.

Feature types distinguish between features controlled remotely via a configuration service and features managed entirely on the local device. This classification helps organize features in the UI and determines the available controls.

Usage

The type is automatically determined from the Feature subclass:

Persistence

When persisting the type to storage, use the ordinal property to store it as an integer, and fromOrdinal to restore it:

// Saving
preferences[key] = featureType.ordinal

// Restoring
val restoredType = FeatureType.fromOrdinal(preferences[key] ?: 0)

Filtering

The FeatureFlip UI allows filtering features by type, making it easy to find specific categories of features during development and testing.

See also

Entries

Link copied to clipboard

A remotely-controlled feature flag.

Link copied to clipboard

A locally-controlled feature flag.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.