Interface TogglzConfig


  • public interface TogglzConfig
    This 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 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 the Feature interface.
        Returns:
        The feature enum, never null
      • getStateRepository

        StateRepository getStateRepository()

        The StateRepository Togglz 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 UserProvider Togglz 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 return NoOpUserProvider here.

        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