Class Event.FeatureRequest
java.lang.Object
com.launchdarkly.sdk.server.interfaces.Event
com.launchdarkly.sdk.server.interfaces.Event.FeatureRequest
- Enclosing class:
- Event
public static final class Event.FeatureRequest extends Event
An event generated by a feature flag evaluation.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.launchdarkly.sdk.server.interfaces.Event
Event.Custom, Event.FeatureRequest, Event.Identify, Event.Index
-
Constructor Summary
Constructors Constructor Description FeatureRequest(long timestamp, java.lang.String key, LDUser user, int version, int variation, LDValue value, LDValue defaultVal, EvaluationReason reason, java.lang.String prereqOf, boolean trackEvents, long debugEventsUntilDate, boolean debug)
Constructs a feature request event. -
Method Summary
Modifier and Type Method Description long
getDebugEventsUntilDate()
If debugging is enabled for this flag, the Unix millisecond time at which to stop debugging.LDValue
getDefaultVal()
The application default value used in the evaluation.java.lang.String
getKey()
The key of the feature flag that was evaluated.java.lang.String
getPrereqOf()
If this flag was evaluated as a prerequisite for another flag, the key of the other flag.EvaluationReason
getReason()
TheEvaluationReason
for this evaluation, or null if the reason was not requested for this evaluation.LDValue
getValue()
The value of the selected flag variation.int
getVariation()
The index of the selected flag variation, or -1 if the application default value was used.int
getVersion()
The version of the feature flag that was evaluated, or -1 if the flag was not found.boolean
isDebug()
True if this event was generated due to debugging being enabled.boolean
isTrackEvents()
True if full event tracking is enabled for this flag.
-
Constructor Details
-
FeatureRequest
public FeatureRequest(long timestamp, java.lang.String key, LDUser user, int version, int variation, LDValue value, LDValue defaultVal, EvaluationReason reason, java.lang.String prereqOf, boolean trackEvents, long debugEventsUntilDate, boolean debug)Constructs a feature request event.- Parameters:
timestamp
- the timestamp in millisecondskey
- the flag keyuser
- the user associated with the eventversion
- the flag version, or -1 if the flag was not foundvariation
- the result variation, or -1 if there was an errorvalue
- the result valuedefaultVal
- the default value passed by the applicationreason
- the evaluation reason, if it is to be included in the eventprereqOf
- if this flag was evaluated as a prerequisite, this is the key of the flag that referenced ittrackEvents
- true if full event tracking is turned on for this flagdebugEventsUntilDate
- if non-null, the time until which event debugging should be enableddebug
- true if this is a debugging event- Since:
- 4.8.0
-
-
Method Details
-
getKey
public java.lang.String getKey()The key of the feature flag that was evaluated.- Returns:
- the flag key
-
getVariation
public int getVariation()The index of the selected flag variation, or -1 if the application default value was used.- Returns:
- zero-based index of the variation, or -1
-
getValue
The value of the selected flag variation.- Returns:
- the value
-
getDefaultVal
The application default value used in the evaluation.- Returns:
- the application default
-
getVersion
public int getVersion()The version of the feature flag that was evaluated, or -1 if the flag was not found.- Returns:
- the flag version or null
-
getPrereqOf
public java.lang.String getPrereqOf()If this flag was evaluated as a prerequisite for another flag, the key of the other flag.- Returns:
- a flag key or null
-
isTrackEvents
public boolean isTrackEvents()True if full event tracking is enabled for this flag.- Returns:
- true if full event tracking is on
-
getDebugEventsUntilDate
public long getDebugEventsUntilDate()If debugging is enabled for this flag, the Unix millisecond time at which to stop debugging.- Returns:
- a timestamp or zero
-
getReason
TheEvaluationReason
for this evaluation, or null if the reason was not requested for this evaluation.- Returns:
- a reason object or null
-
isDebug
public boolean isDebug()True if this event was generated due to debugging being enabled.- Returns:
- true if this is a debug event
-