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
Modifier and TypeFieldDescriptionstatic final String
The 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 TypeMethodDescriptionboolean
isAvailable
(@NotNull String featureToggleName) Test if a feature toggle is explicitly set by configuration, system property or internal FirstSpirit enum.boolean
Get the value for a given feature toggle name or returntrue
if the toggle is not set or unknown as the default value.boolean
Get 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:
true
if the feature toggle is set by configuration, system property or internal FirstSpirit enum,false
if the feature toggle is unknown.- Since:
- 5.2.241102
-
isEnabled
Get the value for a given feature toggle name or returntrue
if 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:
true
it the feature toggle is enabled or not set or unknown,false
if 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:
true
it the feature toggle is enabled,false
if it is disabled, or the default value if the toggle is not set or unknown.- Since:
- 5.2.241102
-