android-components / mozilla.components.service.fretboard / Fretboard

# Fretboard

`class Fretboard` (source)

Entry point of the library

### Constructors

<init> | `Fretboard(source: ExperimentSource, storage: ExperimentStorage, valuesProvider: ValuesProvider = ValuesProvider())` Entry point of the library

### Properties

experiments | `val experiments: List<Experiment>` Provides the list of experiments (active or not)

### Functions

clearAllOverrides | `fun clearAllOverrides(context: Context): Unit` Clears all experiment overrides asynchronously
clearAllOverridesNow | `fun clearAllOverridesNow(context: Context): Unit` Clears all experiment overrides as a blocking operation
clearOverride | `fun clearOverride(context: Context, descriptor: ExperimentDescriptor): Unit` Clears an override for a specified experiment asynchronously
clearOverrideNow | `fun clearOverrideNow(context: Context, descriptor: ExperimentDescriptor): Unit` Clears an override for a specified experiment as a blocking operation
getActiveExperiments | `fun getActiveExperiments(context: Context): List<Experiment>` Provides the list of active experiments
getExperiment | `fun getExperiment(descriptor: ExperimentDescriptor): Experiment?` Gets the metadata associated with the specified experiment, even if the user is not part of it
getExperimentsMap | `fun getExperimentsMap(context: Context): Map<String, Boolean>` Provides a map of active/inactive experiments
getUserBucket | `fun getUserBucket(context: Context): Int` Returns the user bucket number used to determine whether the user is in or out of the experiment
isInExperiment | `fun isInExperiment(context: Context, descriptor: ExperimentDescriptor): Boolean` Checks if the user is part of the specified experiment
loadExperiments | `fun loadExperiments(): Unit` Loads experiments from local storage
setOverride | `fun setOverride(context: Context, descriptor: ExperimentDescriptor, active: Boolean): Unit` Overrides a specified experiment asynchronously
setOverrideNow | `fun setOverrideNow(context: Context, descriptor: ExperimentDescriptor, active: Boolean): Unit` Overrides a specified experiment as a blocking operation
updateExperiments | `fun updateExperiments(): Boolean` Requests new experiments from the server and saves them to local storage
withExperiment | `fun withExperiment(context: Context, descriptor: ExperimentDescriptor, block: (Experiment) -> Unit): Unit` Performs an action if the user is part of the specified experiment