com.vaadin.experimental.

Class FeatureFlags

  • All Implemented Interfaces:

    Serializable


    public class FeatureFlags
    extends Object
    implements Serializable

    Tracks available feature flags and their status. Enabled feature flags are stored in vaadin-featureflags.properties inside the resources folder (src/main/resources).

    See Also:

    Serialized Form

    • Constructor Detail

      • FeatureFlags

        public FeatureFlags(Lookup lookup)

        Generate FeatureFlags with given lookup data.

        Parameters:

        lookup - lookup to use

    • Method Detail

      • get

        public static FeatureFlags get(VaadinContext context)

        Gets the FeatureFlags for the given Vaadin context. If the Vaadin context has no FeatureFlags, a new instance is created and assigned to the context.

        Parameters:

        context - the vaadin context for which to get FeatureFlags from, not null

        Returns:

        a feature flags instance for the given context, not null

      • setPropertiesLocation

        public void setPropertiesLocation(File propertiesFolder)

        Set by the Maven / Gradle plugin when running through that so the feature flags will be correctly detected.

      • getFeatures

        public List<Feature> getFeatures()

        Get a list of all available features and their status.

        Returns:

        a list of all features

      • isEnabled

        public boolean isEnabled(Feature feature)

        Checks if the given feature is enabled.

        Parameters:

        feature - the feature to check

        Returns:

        true if enabled, false otherwise

      • isEnabled

        public boolean isEnabled(String featureId)

        Checks if the given feature is enabled.

        Parameters:

        featureId - the feature to check

        Returns:

        true if enabled, false otherwise

      • setEnabled

        public void setEnabled(String featureId,
                               boolean enabled)

        Enables or disables the given feature.

        Parameters:

        featureId - the feature id

        enabled - true to enable, false to disable