public class Flags extends Object
| Constructor and Description |
|---|
Flags() |
| Modifier and Type | Method and Description |
|---|---|
static Flags |
fromApiFlags(com.fasterxml.jackson.databind.JsonNode apiFlags,
AnalyticsProcessor analyticsProcessor,
FlagsmithFlagDefaults defaultFlagHandler)
Return the flags instance.
|
static Flags |
fromApiFlags(List<FeatureStateModel> apiFlags,
AnalyticsProcessor analyticsProcessor,
FlagsmithFlagDefaults defaultFlagHandler)
Return the flags instance.
|
static Flags |
fromFeatureStateModels(List<FeatureStateModel> featureStates,
AnalyticsProcessor analyticsProcessor)
Build flags object from list of feature states.
|
static Flags |
fromFeatureStateModels(List<FeatureStateModel> featureStates,
AnalyticsProcessor analyticsProcessor,
Object identityId)
Build flags object from list of feature states.
|
static Flags |
fromFeatureStateModels(List<FeatureStateModel> featureStates,
AnalyticsProcessor analyticsProcessor,
Object identityId,
DefaultFlagHandler defaultFlagHandler)
Build flags object from list of feature states.
|
List<BaseFlag> |
getAllFlags()
returns the list of all flags.
|
Object |
getFeatureValue(String featureName)
Get the feature value, null if not present.
|
BaseFlag |
getFlag(String featureName)
Get the feature, null if not present.
|
Boolean |
isFeatureEnabled(String featureName)
is feature enabled, null if not present.
|
public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor)
featureStates - list of feature statesanalyticsProcessor - instance of analytics processorpublic static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, Object identityId)
featureStates - list of feature statesanalyticsProcessor - instance of analytics processoridentityId - identity ID (optional)public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, Object identityId, DefaultFlagHandler defaultFlagHandler)
featureStates - list of feature statesanalyticsProcessor - instance of analytics processoridentityId - identity ID (optional)defaultFlagHandler - default flags (optional)public static Flags fromApiFlags(com.fasterxml.jackson.databind.JsonNode apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)
apiFlags - Dictionary with api flagsanalyticsProcessor - instance of analytics processordefaultFlagHandler - handler for default flags if presentpublic static Flags fromApiFlags(List<FeatureStateModel> apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)
apiFlags - Dictionary with api flagsanalyticsProcessor - instance of analytics processordefaultFlagHandler - handler for default flags if presentpublic Boolean isFeatureEnabled(String featureName) throws FlagsmithClientError
featureName - Feature nameFlagsmithClientErrorpublic Object getFeatureValue(String featureName) throws FlagsmithClientError
featureName - Feature nameFlagsmithClientErrorpublic BaseFlag getFlag(String featureName) throws FlagsmithClientError
featureName - feature nameFlagsmithClientErrorCopyright © 2022. All rights reserved.