Package com.sap.cds.services.request
Interface FeatureTogglesInfo
public interface FeatureTogglesInfo
Class that provides information about features of the application that can be enabled or disabled at runtime.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FeatureTogglesInfo
all()
Creates aFeatureTogglesInfo
object.static FeatureTogglesInfo
create
(FeatureToggle... featureToggles) Creates aFeatureTogglesInfo
object.static FeatureTogglesInfo
create
(List<FeatureToggle> featureToggles) Creates aFeatureTogglesInfo
object.static FeatureTogglesInfo
Creates aFeatureTogglesInfo
object.getFeatureToggle
(String feature) boolean
Provides information whether a feature is enabled or not.static FeatureTogglesInfo
none()
Creates aFeatureTogglesInfo
object.
-
Method Details
-
create
Creates aFeatureTogglesInfo
object.- Parameters:
featureToggles
- The feature toggles- Returns:
- A
FeatureTogglesInfo
object containing all provided feature toggles
-
create
Creates aFeatureTogglesInfo
object.- Parameters:
featureToggles
- AList
of feature toggles- Returns:
- A
FeatureTogglesInfo
object containing all provided feature toggles in the stream
-
create
Creates aFeatureTogglesInfo
object.- Parameters:
featureToggles
- AMap
where the key is the feature name and the value indicates if the feature is enable or not- Returns:
- A
FeatureTogglesInfo
object containing the feature toggles created from the map entries
-
all
Creates aFeatureTogglesInfo
object.- Returns:
- A
FeatureTogglesInfo
object containing all feature toggles
-
none
Creates aFeatureTogglesInfo
object.- Returns:
- A
FeatureTogglesInfo
object without any toggles
-
isEnabled
Provides information whether a feature is enabled or not.- Parameters:
feature
- The name of the feature- Returns:
true
if the feature is enabled,false
otherwise
-
getFeatureToggles
Stream<FeatureToggle> getFeatureToggles()- Returns:
- A
Stream
that contains all feature toggles
-
getEnabledFeatureToggles
Stream<FeatureToggle> getEnabledFeatureToggles()- Returns:
- A
Stream
of the currently enabled features
-
getFeatureToggle
- Parameters:
feature
- the feature name- Returns:
- The
FeatureToggle
for the given feature name ornull
if not existing
-