Class Flags

java.lang.Object
com.flagsmith.models.Flags

public class Flags extends Object
  • 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 states
      analyticsProcessor - instance of analytics processor
    • fromFeatureStateModels

      public static Flags fromFeatureStateModels(List<FeatureStateModel> featureStates, AnalyticsProcessor analyticsProcessor, DefaultFlagHandler defaultFlagHandler)
      Build flags object from list of feature states.
      Parameters:
      featureStates - list of feature states
      analyticsProcessor - instance of analytics processor
      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 flags
      analyticsProcessor - instance of analytics processor
      defaultFlagHandler - 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 flags
      analyticsProcessor - instance of analytics processor
      defaultFlagHandler - handler for default flags if present
    • fromEvaluationResult

      public static Flags fromEvaluationResult(EvaluationResult evaluationResult, AnalyticsProcessor analyticsProcessor, DefaultFlagHandler defaultFlagHandler)
      Build flags object from evaluation result.
      Parameters:
      evaluationResult - evaluation result
      analyticsProcessor - instance of analytics processor
      defaultFlagHandler - handler for default flags if present
    • getAllFlags

      public List<BaseFlag> getAllFlags()
      returns the list of all flags.
    • isFeatureEnabled

      public boolean isFeatureEnabled(String featureName) throws FlagsmithClientError
      is feature enabled, null if not present.
      Parameters:
      featureName - Feature name
      Throws:
      FlagsmithClientError
    • getFeatureValue

      public Object getFeatureValue(String featureName) throws FlagsmithClientError
      Get the feature value, null if not present.
      Parameters:
      featureName - Feature name
      Throws:
      FlagsmithClientError
    • getFlag

      public BaseFlag getFlag(String featureName) throws FlagsmithClientError
      Get the feature, null if not present.
      Parameters:
      featureName - feature name
      Throws:
      FlagsmithClientError