-
- All Implemented Interfaces:
-
io.getunleash.android.Unleash,java.io.Closeable,java.lang.AutoCloseable
public final class DefaultUnleash implements Unleash
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultUnleash.Companion
-
Constructor Summary
Constructors Constructor Description DefaultUnleash(Context androidContext, UnleashConfig unleashConfig, UnleashContext unleashContext, ToggleCache cacheImpl, List<UnleashListener> eventListeners, Lifecycle lifecycle, CoroutineScope coroutineScope)
-
Method Summary
Modifier and Type Method Description final Unitstart(List<UnleashListener> eventListeners, File bootstrapFile, List<Toggle> bootstrap)BooleanisEnabled(String toggleName, Boolean defaultValue)VariantgetVariant(String toggleName, Variant defaultValue)UnitrefreshTogglesNow()This function forces a refresh of the toggles from the server and wait until the refresh is complete or failed. UnitrefreshTogglesNowAsync()This function forces a refresh of the toggles from the server asynchronously using the IO dispatcher. UnitsendMetricsNow()This function forces send metrics to the server and wait until the send is complete or failed. UnitsendMetricsNowAsync()This function forces send metrics to the server asynchronously using the IO dispatcher. BooleanisReady()UnitsetContext(UnleashContext context)Set context and trigger a fetch of the latest toggles immediately and block until the fetch is complete or failed. UnitsetContextWithTimeout(UnleashContext context, Long timeout)Set context and trigger a fetch of the latest toggles asynchronously UnitsetContextAsync(UnleashContext context)Set context and trigger a fetch of the latest toggles asynchronously UnitaddUnleashEventListener(UnleashListener listener)Unitclose()-
-
Constructor Detail
-
DefaultUnleash
DefaultUnleash(Context androidContext, UnleashConfig unleashConfig, UnleashContext unleashContext, ToggleCache cacheImpl, List<UnleashListener> eventListeners, Lifecycle lifecycle, CoroutineScope coroutineScope)
-
-
Method Detail
-
start
final Unit start(List<UnleashListener> eventListeners, File bootstrapFile, List<Toggle> bootstrap)
-
getVariant
Variant getVariant(String toggleName, Variant defaultValue)
-
refreshTogglesNow
Unit refreshTogglesNow()
This function forces a refresh of the toggles from the server and wait until the refresh is complete or failed. Usually, this is done automatically in the background, but you can call this function to force a refresh.
-
refreshTogglesNowAsync
Unit refreshTogglesNowAsync()
This function forces a refresh of the toggles from the server asynchronously using the IO dispatcher. Usually, this is done automatically in the background, but you can call this function to force a refresh.
-
sendMetricsNow
Unit sendMetricsNow()
This function forces send metrics to the server and wait until the send is complete or failed. Usually, this is done automatically in the background, but you can call this function to force a send.
-
sendMetricsNowAsync
Unit sendMetricsNowAsync()
This function forces send metrics to the server asynchronously using the IO dispatcher. Usually, this is done automatically in the background, but you can call this function to force a send.
-
setContext
Unit setContext(UnleashContext context)
Set context and trigger a fetch of the latest toggles immediately and block until the fetch is complete or failed.
-
setContextWithTimeout
Unit setContextWithTimeout(UnleashContext context, Long timeout)
Set context and trigger a fetch of the latest toggles asynchronously
-
setContextAsync
Unit setContextAsync(UnleashContext context)
Set context and trigger a fetch of the latest toggles asynchronously
-
addUnleashEventListener
Unit addUnleashEventListener(UnleashListener listener)
-
-
-
-