ExperimentClient

interface ExperimentClient

An experiment client manages a set of experiments and flags for a given user.

Functions

all
Link copied to clipboard
abstract fun all(): Map<String, Variant>
Returns all variants for the user.
fetch
Link copied to clipboard
abstract fun fetch(user: ExperimentUser? = null): Future<ExperimentClient>
Assign the given user to the SDK and asynchronously fetch all variants from the server.
getUser
Link copied to clipboard
abstract fun getUser(): ExperimentUser?
Get the user for the experiment client.
getUserProvider
Link copied to clipboard
abstract fun getUserProvider(): ExperimentUserProvider?
Get the user provider if it exists.
setUser
Link copied to clipboard
abstract fun setUser(user: ExperimentUser)
Set the user within the client.
setUserProvider
Link copied to clipboard
abstract fun setUserProvider(provider: ExperimentUserProvider?): ExperimentClient
Sets a user provider that will inject identity information into the user for fetch requests.
variant
Link copied to clipboard
abstract fun variant(key: String): Variant
Returns the stored variant for the provided key.
abstract fun variant(key: String, fallback: Variant? = null): Variant
Returns the stored variant for the provided key.