Package org.togglz.core.manager
Class FeatureManagerBuilder
- java.lang.Object
-
- org.togglz.core.manager.FeatureManagerBuilder
-
public class FeatureManagerBuilder extends Object
Builder ofDefaultFeatureManager.- Author:
- Christian Kaltepoth
-
-
Constructor Summary
Constructors Constructor Description FeatureManagerBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FeatureManagerBuilderactivationStrategy(ActivationStrategy strategy)Adds an additionalActivationStrategyto the currentActivationStrategyProvider.FeatureManagerBuilderactivationStrategyProvider(ActivationStrategyProvider strategyProvider)Use the suppliedActivationStrategyProviderfor the activation strategies;static FeatureManagerBuilderbegin()Create a new builderFeatureManagerbuild()Create theFeatureManagerusing the current configuration of the builderFeatureManagerBuilderfeatureClass(Class<? extends Feature> featureClass)Deprecated.FeatureManagerBuilderfeatureEnum(Class<? extends Feature> featureEnum)Use the supplied feature enum class for the feature manager.FeatureManagerBuilderfeatureEnums(Class<? extends Feature>... featureEnum)Use the supplied feature enum classes for the feature manager.FeatureManagerBuilderfeatureProvider(FeatureProvider featureProvider)Sets aFeatureProviderfor the feature manager.FeatureManagerBuildername(String name)Sets the name of the feature manager.FeatureManagerBuilderstateRepository(StateRepository stateRepository)Use the supplied state repository for the feature manager.FeatureManagerBuildertogglzConfig(TogglzConfig config)Initialize the builder with the configuration from the suppliedTogglzConfiginstance.FeatureManagerBuilderuserProvider(UserProvider userProvider)Use the suppliedUserProviderfor the feature manager.
-
-
-
Method Detail
-
begin
public static FeatureManagerBuilder begin()
Create a new builder
-
stateRepository
public FeatureManagerBuilder stateRepository(StateRepository stateRepository)
Use the supplied state repository for the feature manager.
-
featureClass
@Deprecated public FeatureManagerBuilder featureClass(Class<? extends Feature> featureClass)
Deprecated.UsefeatureEnum(Class)instead.
-
featureEnum
public FeatureManagerBuilder featureEnum(Class<? extends Feature> 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
public 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
public FeatureManagerBuilder name(String name)
Sets the name of the feature manager. This name will then be available thoughtFeatureManager.getName().
-
featureProvider
public FeatureManagerBuilder featureProvider(FeatureProvider featureProvider)
Sets aFeatureProviderfor the feature manager. Only useful if you don't use enums to declare your features.
-
userProvider
public FeatureManagerBuilder userProvider(UserProvider userProvider)
Use the suppliedUserProviderfor the feature manager.
-
activationStrategyProvider
public FeatureManagerBuilder activationStrategyProvider(ActivationStrategyProvider strategyProvider)
Use the suppliedActivationStrategyProviderfor the activation strategies;
-
activationStrategy
public FeatureManagerBuilder activationStrategy(ActivationStrategy strategy)
Adds an additionalActivationStrategyto the currentActivationStrategyProvider. This currently only works if you are using theDefaultActivationStrategyProvider.
-
togglzConfig
public FeatureManagerBuilder togglzConfig(TogglzConfig config)
Initialize the builder with the configuration from the suppliedTogglzConfiginstance.
-
build
public FeatureManager build()
Create theFeatureManagerusing the current configuration of the builder
-
-