Package org.togglz.core.manager
Class FeatureManagerBuilder
java.lang.Object
org.togglz.core.manager.FeatureManagerBuilder
Builder of
DefaultFeatureManager.- Author:
- Christian Kaltepoth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactivationStrategy(ActivationStrategy strategy) Adds an additionalActivationStrategyto the currentActivationStrategyProvider.activationStrategyProvider(ActivationStrategyProvider strategyProvider) Use the suppliedActivationStrategyProviderfor the activation strategies;static FeatureManagerBuilderbegin()Create a new builderbuild()Create theFeatureManagerusing the current configuration of the builderfeatureEnum(Class<? extends Feature> featureEnum) Use the supplied feature enum class for the feature manager.final FeatureManagerBuilderfeatureEnums(Class<? extends Feature>... featureEnum) Use the supplied feature enum classes for the feature manager.featureProvider(FeatureProvider featureProvider) Sets aFeatureProviderfor the feature manager.Sets the name of the feature manager.stateRepository(StateRepository stateRepository) Use the supplied state repository for the feature manager.togglzConfig(TogglzConfig config) Initialize the builder with the configuration from the suppliedTogglzConfiginstance.userProvider(UserProvider userProvider) Use the suppliedUserProviderfor the feature manager.
-
Constructor Details
-
FeatureManagerBuilder
public FeatureManagerBuilder()
-
-
Method Details
-
begin
Create a new builder -
stateRepository
Use the supplied state repository for the feature manager. -
featureEnum
Use the supplied feature enum class for the feature manager. Same as callingfeatureProvider(FeatureProvider)withEnumBasedFeatureProvider. Please note calling this method also set the name of the feature manager to the simple name of the feature enum's type. -
featureEnums
@SafeVarargs public final FeatureManagerBuilder featureEnums(Class<? extends Feature>... featureEnum) Use the supplied feature enum classes for the feature manager. Same as callingfeatureProvider(FeatureProvider)withEnumBasedFeatureProvider. Please note calling this method also set the name of the feature manager to the simple name of the first feature enum's type. -
name
Sets the name of the feature manager. This name will then be available thoughtFeatureManager.getName(). -
featureProvider
Sets aFeatureProviderfor the feature manager. Only useful if you don't use enums to declare your features. -
userProvider
Use the suppliedUserProviderfor the feature manager. -
activationStrategyProvider
public FeatureManagerBuilder activationStrategyProvider(ActivationStrategyProvider strategyProvider) Use the suppliedActivationStrategyProviderfor the activation strategies; -
activationStrategy
Adds an additionalActivationStrategyto the currentActivationStrategyProvider. This currently only works if you are using theDefaultActivationStrategyProvider. -
togglzConfig
Initialize the builder with the configuration from the suppliedTogglzConfiginstance. -
build
Create theFeatureManagerusing the current configuration of the builder
-