Package com.launchdarkly.sdk.fdv2
Class Selector
java.lang.Object
com.launchdarkly.sdk.fdv2.Selector
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleangetState()The state associated with the payload.intThe version of the data associated with this selector.inthashCode()booleanisEmpty()If true, then this selector is empty.static SelectorCreates a new Selector with the given version and state.toString()
-
Field Details
-
EMPTY
An empty selector instance. Custom data source implementations should always use this value when constructing aChangeSet.
-
-
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
The state associated with the payload.- Returns:
- the state identifier, or null if empty
-
make
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
EMPTYinstead.- Parameters:
version- the version numberstate- the state identifier- Returns:
- a new Selector instance
-
equals
-
hashCode
public int hashCode() -
toString
-