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()
    The EvaluationReason 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.

    Methods inherited from class com.launchdarkly.sdk.server.interfaces.Event

    getCreationDate, getUser

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 milliseconds
      key - the flag key
      user - the user associated with the event
      version - the flag version, or -1 if the flag was not found
      variation - the result variation, or -1 if there was an error
      value - the result value
      defaultVal - the default value passed by the application
      reason - the evaluation reason, if it is to be included in the event
      prereqOf - if this flag was evaluated as a prerequisite, this is the key of the flag that referenced it
      trackEvents - true if full event tracking is turned on for this flag
      debugEventsUntilDate - if non-null, the time until which event debugging should be enabled
      debug - 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

      public LDValue getValue()
      The value of the selected flag variation.
      Returns:
      the value
    • getDefaultVal

      public LDValue 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

      public EvaluationReason getReason()
      The EvaluationReason 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