public class FeatureFlags extends Object implements Serializable
vaadin-featureflags.properties
inside the resources folder
(src/main/resources
).Modifier and Type | Class and Description |
---|---|
protected static class |
FeatureFlags.FeatureFlagsWrapper
FeatureFlags wrapper class for storing the FeatureFlags object.
|
Modifier and Type | Field and Description |
---|---|
static Feature |
EXAMPLE |
static String |
PROPERTIES_FILENAME |
static Feature |
VITE |
Constructor and Description |
---|
FeatureFlags(Lookup lookup)
Generate FeatureFlags with given lookup data.
|
Modifier and Type | Method and Description |
---|---|
static FeatureFlags |
get(VaadinContext context)
Gets the FeatureFlags for the given Vaadin context.
|
List<Feature> |
getFeatures()
Get a list of all available features and their status.
|
boolean |
isEnabled(Feature feature)
Checks if the given feature is enabled.
|
boolean |
isEnabled(String featureId)
Checks if the given feature is enabled.
|
void |
setEnabled(String featureId,
boolean enabled)
Enables or disables the given feature.
|
void |
setPropertiesLocation(File propertiesFolder)
Set by the Maven / Gradle plugin when running through that so the feature
flags will be correctly detected.
|
public static final String PROPERTIES_FILENAME
public static final Feature EXAMPLE
public static final Feature VITE
public FeatureFlags(Lookup lookup)
lookup
- lookup to usepublic static FeatureFlags get(VaadinContext context)
context
- the vaadin context for which to get FeatureFlags from, not
null
null
public void setPropertiesLocation(File propertiesFolder)
public List<Feature> getFeatures()
public boolean isEnabled(Feature feature)
feature
- the feature to checktrue
if enabled, false
otherwisepublic boolean isEnabled(String featureId)
featureId
- the feature to checktrue
if enabled, false
otherwisepublic void setEnabled(String featureId, boolean enabled)
featureId
- the feature idenabled
- true
to enable, false
to disableCopyright © 2024. All rights reserved.