State
data class State(val remoteEnableState: Boolean? = null, val enable: Boolean = false, val minSupportedVersion: Int? = null, val rollout: List<Double>? = null, val rolloutThreshold: Double? = null, val targets: List<Toggle.State.Target> = emptyList(), val metadataInfo: String? = null, val cohorts: List<Toggle.State.Cohort> = emptyList(), val assignedCohort: Toggle.State.Cohort? = null, val settings: String? = null)
This represents the state of a Toggle
Parameters
remoteEnableState
is the enabled/disabled state in the remote config
enable
is the ultimate (computed) enabled state
minSupportedVersion
is the lowest Android version for which this toggle can be enabled
rollout
is the rollout specified in remote config
rolloutThreshold
is the percentile for which this flag will be enabled. It's a value between 0-1 Example: If rolloutThreshold = 0.3, if rollout is <0.3 then the toggle will be disabled
targets
specified the target audience for this toggle. If the user is not within the targets the toggle will be disabled
metadataInfo
Some metadata info about the toggle. It is not stored and its computed when calling getRawStoredState.
Constructors
Link copied to clipboard
constructor(remoteEnableState: Boolean? = null, enable: Boolean = false, minSupportedVersion: Int? = null, rollout: List<Double>? = null, rolloutThreshold: Double? = null, targets: List<Toggle.State.Target> = emptyList(), metadataInfo: String? = null, cohorts: List<Toggle.State.Cohort> = emptyList(), assignedCohort: Toggle.State.Cohort? = null, settings: String? = null)