Togglz

What is it about?

Togglz is an implementation of the Feature Toggles pattern for Java. Feature Toggles are a very common agile development practices in the context of continuous deployment and delivery. The basic idea is to associate a toggle with each new feature you are working on. This allows you to enable or disable these features at application runtime, even for individual users.

Want to learn more? Have a look at an usage example or check the quickstart guide.

News

08-Mar-2017
Togglz 2.4.1.Final released
We released Togglz 2.4.1.Final today. This version fixes two bugs that were introduced in the 2.4.0.Final release. If you want to learn more, have a look at the what's new page!
22-Feb-2017
Togglz 2.4.0.Final released
We are very happy to announce the release of Togglz 2.4.0.Final. This new version adds some new modules which have been contributed by the community. See the what's new page for all details. Enjoy!
30-Jul-2016
Togglz 2.3.0.Final released
We are very proud to announce the release of Togglz 2.3.0.Final. Thanks to everyone who helped to get this release out. You can learn more about the latest changes on the what's new page. Also have a look at the updating notes for important changes since 2.2.0.Final. Enjoy!
17-Jun-2016
Togglz 2.3.0.RC2 released
We are happy to announce the release of Togglz 2.3.0.RC2. This new version adds some major new features which have been contributed by the community. See the what's new page for all details. We are planning to release Togglz 2.3.0.Final very soon. So please give RC2 a try and report every problem you run into. The simplest way to contact us is to use the new Gitter chat room. Please let us know what you think!

Example

Features are declared using a regular Java enum type:

public enum MyFeatures implements Feature {

    @Label("First Feature")
    FEATURE_ONE,

    @Label("Second Feature")
    FEATURE_TWO;

    public boolean isActive() {
        return FeatureContext.getFeatureManager().isActive(this);
    }

}

Checking whether a specific feature is enabled for the current user is very simple. Just call the isActive() method on the feature.

public void someBusinessMethod() {

  if( MyFeatures.FEATURE_ONE.isActive() ) {
    // do new exciting stuff here
  }

  [...]

}

You can find more details in the quickstart guide.