Interface Feature
- All Known Implementing Classes:
IntegrationApiFeature,OutboundSyncFeature
public interface Feature
Represents a Feature for feature toggling. The intent of this interface
is for enumerations to implement it. In a properties file, also define
the property and set to true/false.
Here's an example of a Feature implementation:
public enum MyFeature implements Feature {
MY_FEATURE("my.feature.enabled")
private final String property;
MyFeature(final String property) {
this.property = property;
}
public String getProperty() {
return property;
}
}
In a property file
my.feature.enabled=true
-
Method Details
-
getProperty
String getProperty()Gets the property related to the feature enum- Returns:
- Feature's property name
-
isEnabled
default boolean isEnabled()Indicates whether the feature is enabled- Returns:
trueif the feature is enabled, else false
-
enable
default void enable()Turns on the feature -
disable
default void disable()Turns off the feature
-