Class FeatureContext
Represents a feature context for feature flag evaluation.
-
Constructor Summary
ConstructorsConstructorDescriptionNo args constructor for use in serializationFeatureContext(FeatureContext source) FeatureContext(String key, String name, Boolean enabled, Object value, List<FeatureValue> variants, Double priority, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionbooleanEnabledgetKey()KeyFeatureMetadatagetName()NameFeaturePrioritygetValue()ValueVariantsinthashCode()voidsetAdditionalProperty(String name, Object value) voidsetEnabled(Boolean enabled) EnabledvoidKeyvoidsetMetadata(Map<String, Object> metadata) FeatureMetadatavoidNamevoidsetPriority(Double priority) FeaturePriorityvoidValuevoidsetVariants(List<FeatureValue> variants) VariantstoString()withAdditionalProperty(String name, Object value) withEnabled(Boolean enabled) withMetadata(Map<String, Object> metadata) withPriority(Double priority) withVariants(List<FeatureValue> variants)
-
Constructor Details
-
FeatureContext
public FeatureContext()No args constructor for use in serialization -
FeatureContext
- 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
KeyUnique 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
KeyUnique 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
-
getName
NameFeature name. (Required)
-
setName
NameFeature name. (Required)
-
withName
-
getEnabled
EnabledIndicates whether the feature is enabled in the environment. (Required)
-
setEnabled
EnabledIndicates whether the feature is enabled in the environment. (Required)
-
withEnabled
-
getValue
ValueA default environment value for the feature. If the feature is multivariate, this will be the control value. (Required)
-
setValue
ValueA default environment value for the feature. If the feature is multivariate, this will be the control value. (Required)
-
withValue
-
getVariants
VariantsAn array of environment default values associated with the feature. Empty for standard features, or contains multiple values for multivariate features.
-
setVariants
VariantsAn array of environment default values associated with the feature. Empty for standard features, or contains multiple values for multivariate features.
-
withVariants
-
getPriority
FeaturePriorityPriority of the feature context. Lower values indicate a higher priority when multiple contexts apply to the same feature.
-
setPriority
FeaturePriorityPriority of the feature context. Lower values indicate a higher priority when multiple contexts apply to the same feature.
-
withPriority
-
getMetadata
FeatureMetadataAdditional metadata associated with the feature.
-
setMetadata
FeatureMetadataAdditional metadata associated with the feature.
-
withMetadata
-
getAdditionalProperties
-
setAdditionalProperty
-
withAdditionalProperty
-
toString
-
hashCode
public int hashCode() -
equals
-