Interface TogglzConfig
-
public interface TogglzConfigThis interface represents the configuration of Togglz. It must be implemented by the user to tell Togglz about the feature enum, how feature state is persisted and which way Togglz should use to obtain the current user.- Author:
- Christian Kaltepoth
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<? extends Feature>getFeatureClass()Used to tell Togglz about the feature enum that you want to use.StateRepositorygetStateRepository()TheStateRepositoryTogglz should use to store feature state.UserProvidergetUserProvider()TheUserProviderTogglz should use to obtain the current user.
-
-
-
Method Detail
-
getFeatureClass
Class<? extends Feature> getFeatureClass()
Used to tell Togglz about the feature enum that you want to use. Please note that your feature enum has to implement theFeatureinterface.- Returns:
- The feature enum, never
null
-
getStateRepository
StateRepository getStateRepository()
The
StateRepositoryTogglz should use to store feature state. Please refer to the Togglz documentation of a list of default implementations that ship with Togglz.Please note that this method is only called once. So you can safely implement the method by returning a new instance of an anonymous class.
- Returns:
- The repository, never
null
-
getUserProvider
UserProvider getUserProvider()
The
UserProviderTogglz should use to obtain the current user. Please refer to the Togglz documentation of a list of default implementations that ship with Togglz. If you don't want to be able to toggle feature on a per user basis and are not planning to use the Togglz Console, you can returnNoOpUserProviderhere.Please note that this method is only called once. So you can safely implement the method by returning a new instance of an anonymous class.
- Returns:
- The feature user provider, never
null
-
-