Package com.flagsmith.models
Class Flags
java.lang.Object
com.flagsmith.models.Flags
public class Flags extends Object
-
Constructor Summary
Constructors Constructor Description Flags() -
Method Summary
Modifier and Type Method Description static FlagsfromApiFlags(com.fasterxml.jackson.databind.JsonNode apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)Return the flags instance.static FlagsfromApiFlags(List<FeatureStateModel> apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)Return the flags instance.static FlagsfromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor)Build flags object from list of feature states.static FlagsfromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, Object identityId)Build flags object from list of feature states.static FlagsfromFeatureStateModels(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.ObjectgetFeatureValue(String featureName)Get the feature value, null if not present.BaseFlaggetFlag(String featureName)Get the feature, null if not present.booleanisFeatureEnabled(String featureName)is feature enabled, null if not present.
-
Constructor Details
-
Flags
public Flags()
-
-
Method Details
-
fromFeatureStateModels
public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor)Build flags object from list of feature states.- Parameters:
featureStates- list of feature statesanalyticsProcessor- instance of analytics processor
-
fromFeatureStateModels
public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, Object identityId)Build flags object from list of feature states.- Parameters:
featureStates- list of feature statesanalyticsProcessor- instance of analytics processoridentityId- identity ID (optional)
-
fromFeatureStateModels
public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, Object identityId, DefaultFlagHandler defaultFlagHandler)Build flags object from list of feature states.- Parameters:
featureStates- list of feature statesanalyticsProcessor- instance of analytics processoridentityId- identity ID (optional)defaultFlagHandler- default flags (optional)
-
fromApiFlags
public static Flags fromApiFlags(com.fasterxml.jackson.databind.JsonNode apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)Return the flags instance.- Parameters:
apiFlags- Dictionary with api flagsanalyticsProcessor- instance of analytics processordefaultFlagHandler- handler for default flags if present
-
fromApiFlags
public static Flags fromApiFlags(List<FeatureStateModel> apiFlags, AnalyticsProcessor analyticsProcessor, FlagsmithFlagDefaults defaultFlagHandler)Return the flags instance.- Parameters:
apiFlags- Dictionary with api flagsanalyticsProcessor- instance of analytics processordefaultFlagHandler- handler for default flags if present
-
getAllFlags
returns the list of all flags. -
isFeatureEnabled
is feature enabled, null if not present.- Parameters:
featureName- Feature name- Throws:
FlagsmithClientError
-
getFeatureValue
Get the feature value, null if not present.- Parameters:
featureName- Feature name- Throws:
FlagsmithClientError
-
getFlag
Get the feature, null if not present.- Parameters:
featureName- feature name- Throws:
FlagsmithClientError
-