Class DataStoreTypes.ItemDescriptor
- java.lang.Object
-
- com.launchdarkly.sdk.server.subsystems.DataStoreTypes.ItemDescriptor
-
- Enclosing class:
- DataStoreTypes
public static final class DataStoreTypes.ItemDescriptor extends java.lang.Object
A versioned item (or placeholder) storable in aDataStore
.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.
-
-
Constructor Summary
Constructors Constructor Description ItemDescriptor(int version, java.lang.Object item)
Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataStoreTypes.ItemDescriptor
deletedItem(int version)
Convenience method for constructing a deleted item placeholder.boolean
equals(java.lang.Object o)
java.lang.Object
getItem()
Returns the data item, or null if this is a placeholder for a deleted item.int
getVersion()
Returns the version number of this data, provided by the SDK.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getVersion
public int getVersion()
Returns the version number of this data, provided by the SDK.- Returns:
- the version number
-
getItem
public java.lang.Object getItem()
Returns the data item, or null if this is a placeholder for a deleted item.- Returns:
- an object or null
-
deletedItem
public static DataStoreTypes.ItemDescriptor deletedItem(int version)
Convenience method for constructing a deleted item placeholder.- Parameters:
version
- the version number- Returns:
- an ItemDescriptor
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-