Class FeatureContext

java.lang.Object
com.flagsmith.flagengine.FeatureContext

@Generated("jsonschema2pojo") public class FeatureContext extends Object
FeatureContext

Represents a feature context for feature flag evaluation.

  • Constructor Details

    • FeatureContext

      public FeatureContext()
      No args constructor for use in serialization
    • FeatureContext

      public FeatureContext(FeatureContext source)
      Parameters:
      source - the object being copied
    • FeatureContext

      public FeatureContext(String key, String name, Boolean enabled, Object value, List<FeatureValue> variants, Double priority, Map<String,Object> metadata)
      Parameters:
      key - Key. Unique feature key used when selecting a variant if the feature is multivariate. Set to an internal identifier or a UUID, depending on Flagsmith implementation.
      name - Name. Feature name.
      enabled - Enabled. Indicates whether the feature is enabled in the environment.
      value - Value. A default environment value for the feature. If the feature is multivariate, this will be the control value.
      variants - Variants. An array of environment default values associated with the feature. Empty for standard features, or contains multiple values for multivariate features.
      priority - FeaturePriority. Priority of the feature context. Lower values indicate a higher priority when multiple contexts apply to the same feature.
      metadata - FeatureMetadata. Additional metadata associated with the feature.
  • Method Details

    • getKey

      public String getKey()
      Key

      Unique feature key used when selecting a variant if the feature is multivariate. Set to an internal identifier or a UUID, depending on Flagsmith implementation. (Required)

    • setKey

      public void setKey(String key)
      Key

      Unique feature key used when selecting a variant if the feature is multivariate. Set to an internal identifier or a UUID, depending on Flagsmith implementation. (Required)

    • withKey

      public FeatureContext withKey(String key)
    • getName

      public String getName()
      Name

      Feature name. (Required)

    • setName

      public void setName(String name)
      Name

      Feature name. (Required)

    • withName

      public FeatureContext withName(String name)
    • getEnabled

      public Boolean getEnabled()
      Enabled

      Indicates whether the feature is enabled in the environment. (Required)

    • setEnabled

      public void setEnabled(Boolean enabled)
      Enabled

      Indicates whether the feature is enabled in the environment. (Required)

    • withEnabled

      public FeatureContext withEnabled(Boolean enabled)
    • getValue

      public Object getValue()
      Value

      A default environment value for the feature. If the feature is multivariate, this will be the control value. (Required)

    • setValue

      public void setValue(Object value)
      Value

      A default environment value for the feature. If the feature is multivariate, this will be the control value. (Required)

    • withValue

      public FeatureContext withValue(Object value)
    • getVariants

      public List<FeatureValue> getVariants()
      Variants

      An array of environment default values associated with the feature. Empty for standard features, or contains multiple values for multivariate features.

    • setVariants

      public void setVariants(List<FeatureValue> variants)
      Variants

      An array of environment default values associated with the feature. Empty for standard features, or contains multiple values for multivariate features.

    • withVariants

      public FeatureContext withVariants(List<FeatureValue> variants)
    • getPriority

      public Double getPriority()
      FeaturePriority

      Priority of the feature context. Lower values indicate a higher priority when multiple contexts apply to the same feature.

    • setPriority

      public void setPriority(Double priority)
      FeaturePriority

      Priority of the feature context. Lower values indicate a higher priority when multiple contexts apply to the same feature.

    • withPriority

      public FeatureContext withPriority(Double priority)
    • getMetadata

      public Map<String,Object> getMetadata()
      FeatureMetadata

      Additional metadata associated with the feature.

    • setMetadata

      public void setMetadata(Map<String,Object> metadata)
      FeatureMetadata

      Additional metadata associated with the feature.

    • withMetadata

      public FeatureContext withMetadata(Map<String,Object> metadata)
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • setAdditionalProperty

      public void setAdditionalProperty(String name, Object value)
    • withAdditionalProperty

      public FeatureContext withAdditionalProperty(String name, Object value)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object