Class Selector

java.lang.Object
com.launchdarkly.sdk.fdv2.Selector

public final class Selector extends Object
Identifies a specific version of data in the LaunchDarkly backend, used to request incremental updates from a known point.

A selector is either empty (EMPTY) or contains a version number and state string that were provided by a LaunchDarkly data source. Empty selectors signal that the client has no existing data and requires a full payload.

For SDK consumers implementing custom data sources: you should always use EMPTY when constructing a ChangeSet. Non-empty selectors are set by LaunchDarkly's own data sources based on state received from the LaunchDarkly backend, and are not meaningful when constructed externally.

  • Field Details

    • EMPTY

      public static final Selector EMPTY
      An empty selector instance. Custom data source implementations should always use this value when constructing a ChangeSet.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      If true, then this selector is empty. An empty selector cannot be used as a basis for requesting incremental updates from a data source.
      Returns:
      whether the selector is empty
    • getVersion

      public int getVersion()
      The version of the data associated with this selector.
      Returns:
      the version
    • getState

      public String getState()
      The state associated with the payload.
      Returns:
      the state identifier, or null if empty
    • make

      public static Selector make(int version, String state)
      Creates a new Selector with the given version and state.

      This method is intended for use by LaunchDarkly data sources only. Custom data source implementations should use EMPTY instead.

      Parameters:
      version - the version number
      state - the state identifier
      Returns:
      a new Selector instance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object