Struct DataStoreTypes.ItemDescriptor
A versioned item (or placeholder) storeable in an IDataStore.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Subsystems
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public struct DataStoreTypes.ItemDescriptor
Remarks
This is used for data stores that directly store objects as-is, as the default in-memory store does. Items are typed as object; the store should not know or care what the actual object is.
For any given key within a DataStoreTypes.DataKind, there can be either an existing item with a version, or a "tombstone" placeholder representing a deleted item (also with a version. Deleted item placeholders are used so that if an item is first updated with version N and then deleted with version N+1, but the SDK receives those changes out of order, version N will not overwrite the deletion.
Persistent data stores use DataStoreTypes.SerializedItemDescriptor instead.
Constructors
| Edit this page View SourceItemDescriptor(int, object)
Constructs an instance.
Declaration
public ItemDescriptor(int version, object item)
Parameters
Type | Name | Description |
---|---|---|
int | version | the version number |
object | item | the data item, or null for a deleted item |
Properties
| Edit this page View SourceItem
The data item, or null if this is a placeholder for a deleted item.
Declaration
public object Item { get; }
Property Value
Type | Description |
---|---|
object |
Version
The version number of this data, provided by the SDK.
Declaration
public int Version { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceDeleted(int)
Shortcut for constructing a deleted item placeholder.
Declaration
public static DataStoreTypes.ItemDescriptor Deleted(int version)
Parameters
Type | Name | Description |
---|---|---|
int | version | the version number |
Returns
Type | Description |
---|---|
DataStoreTypes.ItemDescriptor | the item descriptor |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |