Package io.getunleash
Class DefaultUnleash
- java.lang.Object
-
- io.getunleash.DefaultUnleash
-
- All Implemented Interfaces:
Unleash
- Direct Known Subclasses:
DefaultUnleash
public class DefaultUnleash extends Object implements Unleash
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDefaultUnleash.DefaultMore
-
Field Summary
Fields Modifier and Type Field Description static UnknownStrategyUNKNOWN_STRATEGY
-
Constructor Summary
Constructors Constructor Description DefaultUnleash(UnleashConfig unleashConfig, ToggleRepository toggleRepository, Strategy... strategies)DefaultUnleash(UnleashConfig unleashConfig, ToggleRepository toggleRepository, Map<String,Strategy> strategyMap, UnleashContextProvider contextProvider, EventDispatcher eventDispatcher, UnleashMetricService metricService)DefaultUnleash(UnleashConfig unleashConfig, Strategy... strategies)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcount(String toggleName, boolean enabled)Deprecated.Optional<FeatureToggle>getFeatureToggleDefinition(String toggleName)List<String>getFeatureToggleNames()Deprecated.VariantgetVariant(String toggleName)VariantgetVariant(String toggleName, UnleashContext context)VariantgetVariant(String toggleName, UnleashContext context, Variant defaultValue)VariantgetVariant(String toggleName, Variant defaultValue)booleanisEnabled(String toggleName)booleanisEnabled(String toggleName, boolean defaultSetting)booleanisEnabled(String toggleName, UnleashContext context, boolean defaultSetting)booleanisEnabled(String toggleName, UnleashContext context, BiFunction<String,UnleashContext,Boolean> fallbackAction)booleanisEnabled(String toggleName, BiFunction<String,UnleashContext,Boolean> fallbackAction)MoreOperationsmore()voidshutdown()
-
-
-
Field Detail
-
UNKNOWN_STRATEGY
public static final UnknownStrategy UNKNOWN_STRATEGY
-
-
Constructor Detail
-
DefaultUnleash
public DefaultUnleash(UnleashConfig unleashConfig, Strategy... strategies)
-
DefaultUnleash
public DefaultUnleash(UnleashConfig unleashConfig, ToggleRepository toggleRepository, Strategy... strategies)
-
DefaultUnleash
public DefaultUnleash(UnleashConfig unleashConfig, ToggleRepository toggleRepository, Map<String,Strategy> strategyMap, UnleashContextProvider contextProvider, EventDispatcher eventDispatcher, UnleashMetricService metricService)
-
-
Method Detail
-
isEnabled
public boolean isEnabled(String toggleName, boolean defaultSetting)
-
isEnabled
public boolean isEnabled(String toggleName, UnleashContext context, boolean defaultSetting)
-
isEnabled
public boolean isEnabled(String toggleName, BiFunction<String,UnleashContext,Boolean> fallbackAction)
-
isEnabled
public boolean isEnabled(String toggleName, UnleashContext context, BiFunction<String,UnleashContext,Boolean> fallbackAction)
-
getVariant
public Variant getVariant(String toggleName, UnleashContext context)
- Specified by:
getVariantin interfaceUnleash
-
getVariant
public Variant getVariant(String toggleName, UnleashContext context, Variant defaultValue)
- Specified by:
getVariantin interfaceUnleash
-
getVariant
public Variant getVariant(String toggleName)
- Specified by:
getVariantin interfaceUnleash
-
getVariant
public Variant getVariant(String toggleName, Variant defaultValue)
- Specified by:
getVariantin interfaceUnleash
-
getFeatureToggleDefinition
public Optional<FeatureToggle> getFeatureToggleDefinition(String toggleName)
-
getFeatureToggleNames
@Deprecated public List<String> getFeatureToggleNames()
Deprecated.Use more().getFeatureToggleNames() instead- Specified by:
getFeatureToggleNamesin interfaceUnleash- Returns:
- a list of known toggle names
-
count
@Deprecated public void count(String toggleName, boolean enabled)
Deprecated.Use more().count() instead
-
more
public MoreOperations more()
-
-