Class DataStoreTypes.DataKind
Represents a separately namespaced collection of storable data items.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Subsystems
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public sealed class DataStoreTypes.DataKind
Remarks
The SDK passes instances of this type to the data store to specify whether it is referring to a feature flag, a user segment, etc. The data store implementation should not look for a specific data kind (such as feature flags), but should treat all data kinds generically.
Constructors
| Edit this page View SourceDataKind(string, Func<ItemDescriptor, string>, Func<string, ItemDescriptor>)
Constructor for use in testing.
Declaration
public DataKind(string name, Func<DataStoreTypes.ItemDescriptor, string> serializer, Func<string, DataStoreTypes.ItemDescriptor> deserializer)
Parameters
Type | Name | Description |
---|---|---|
string | name | value for the |
Func<DataStoreTypes.ItemDescriptor, string> | serializer | function to convert an item to a serialized string form |
Func<string, DataStoreTypes.ItemDescriptor> | deserializer | function to convert an item from a serialized string form |
Remarks
Application code will not create DataStoreTypes.DataKind instances; the SDK maintains its own instances for the storable data types that it uses.
Properties
| Edit this page View SourceName
A case-sensitive alphabetic string that uniquely identifies this data kind.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This is in effect a namespace for a collection of items of the same kind. Item keys must be unique within that namespace. Persistent data store implementations could use this string as part of a composite key or table name.
Methods
| Edit this page View SourceDeserialize(string)
Creates an item of this kind from its serialized representation.
Declaration
public DataStoreTypes.ItemDescriptor Deserialize(string serializedData)
Parameters
Type | Name | Description |
---|---|---|
string | serializedData | the serialized representation |
Returns
Type | Description |
---|---|
DataStoreTypes.ItemDescriptor | an DataStoreTypes.ItemDescriptor describing the deserialized object |
Remarks
The SDK uses this function to translate data that is returned by an IPersistentDataStore. Store implementations normally do not need to call it, except in a special case described in the documentation for IPersistentDataStore regarding updates.
The returned DataStoreTypes.ItemDescriptor has two properties: Item, which is the deserialized object or a null value for a deleted item placeholder, and Version, which provides the object's version number regardless of whether it is deleted or not.
Serialize(ItemDescriptor)
Returns a serialized representation of an item of this kind.
Declaration
public string Serialize(DataStoreTypes.ItemDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
DataStoreTypes.ItemDescriptor | item |
Returns
Type | Description |
---|---|
string | the serialized representation |
Remarks
The SDK uses this function to generate the data that is stored by an IPersistentDataStore. Store implementations normally do not need to call it, except in a special case described in the documentation for IPersistentDataStore regarding deleted item placeholders.
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |