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

Fretboard

class Fretboard (source)

Entry point of the library

Constructors

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

Properties

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

Functions

Name Summary
clearAllOverrides fun clearAllOverrides(context: <ERROR CLASS>): Unit
Clears all experiment overrides asynchronously
clearAllOverridesNow fun clearAllOverridesNow(context: <ERROR CLASS>): Unit
Clears all experiment overrides as a blocking operation
clearOverride fun clearOverride(context: <ERROR CLASS>, descriptor: ExperimentDescriptor): Unit
Clears an override for a specified experiment asynchronously
clearOverrideNow fun clearOverrideNow(context: <ERROR CLASS>, descriptor: ExperimentDescriptor): Unit
Clears an override for a specified experiment as a blocking operation
getActiveExperiments fun getActiveExperiments(context: <ERROR CLASS>): 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: <ERROR CLASS>): Map<String, Boolean>
Provides a map of active/inactive experiments
getUserBucket fun getUserBucket(context: <ERROR CLASS>): Int
Returns the user bucket number used to determine whether the user is in or out of the experiment
isInExperiment fun isInExperiment(context: <ERROR CLASS>, 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: <ERROR CLASS>, descriptor: ExperimentDescriptor, active: Boolean): Unit
Overrides a specified experiment asynchronously
setOverrideNow fun setOverrideNow(context: <ERROR CLASS>, 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: <ERROR CLASS>, descriptor: ExperimentDescriptor, block: (Experiment) -> Unit): Unit
Performs an action if the user is part of the specified experiment

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.