Package de.espirit.firstspirit.agency
Interface FeatureToggleAgent
public interface FeatureToggleAgent
The
Feature toggle names are always handled case insensitively, and internally they are always stored in an uppercase representation. Using only uppercase characters for a feature toggle name is recommended.
FeatureToggleAgent provides access to feature-toggles set for a FirstSpirit server. The feature toggles
may be set in the server's fs-server.conf file or via Java System properties for the server JVM.Feature toggle names are always handled case insensitively, and internally they are always stored in an uppercase representation. Using only uppercase characters for a feature toggle name is recommended.
- Since:
- 5.2.241102
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe common prefix for features toggle names used in System properties or fs-server.conf entries.static final SpecialistType<FeatureToggleAgent>The agent's technical type to be used to request the agent from aSpecialistsBroker. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAvailable(@NotNull String featureToggleName) Test if a feature toggle is explicitly set by configuration, system property or internal FirstSpirit enum.booleanGet the value for a given feature toggle name or returntrueif the toggle is not set or unknown as the default value.booleanGet the value for a given feature toggle name or return the default value if the toggle is not set or unknown.
-
Field Details
-
TYPE
The agent's technical type to be used to request the agent from aSpecialistsBroker.- Since:
- 5.2.241102
-
FEATURE_TOGGLE_PROPERTY_PREFIX
The common prefix for features toggle names used in System properties or fs-server.conf entries.- Since:
- 5.2.241102
- See Also:
-
-
Method Details
-
isAvailable
Test if a feature toggle is explicitly set by configuration, system property or internal FirstSpirit enum.- Parameters:
featureToggleName- The name of the feature toggle without any prefixes. Feature toggle names are always handled case insensitively, and internally they are always stored in an uppercase representation. Using only uppercase characters in a feature toggle name is recommended.- Returns:
trueif the feature toggle is set by configuration, system property or internal FirstSpirit enum,falseif the feature toggle is unknown.- Since:
- 5.2.241102
-
isEnabled
Get the value for a given feature toggle name or returntrueif the toggle is not set or unknown as the default value.- Parameters:
featureToggleName- The name of the feature toggle without any prefixes. Feature toggle names are always handled case insensitively, and internally they are always stored in an uppercase representation. Using only uppercase characters in a feature toggle name is recommended.- Returns:
trueit the feature toggle is enabled or not set or unknown,falseif it is disabled.- Since:
- 5.2.241102
-
isEnabled
Get the value for a given feature toggle name or return the default value if the toggle is not set or unknown.- Parameters:
featureToggleName- The name of the feature toggle without any prefixes. Feature toggle names are always handled case insensitively, and internally they are always stored in an uppercase representation. Using only uppercase characters in a feature toggle name is recommended.defaultValue- Default value, used if the feature toggle is not set or unknown.- Returns:
trueit the feature toggle is enabled,falseif it is disabled, or the default value if the toggle is not set or unknown.- Since:
- 5.2.241102
-