public static final class DataStoreTypes.ItemDescriptor
extends java.lang.Object
DataStore
.
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 and Description |
---|
ItemDescriptor(int version,
java.lang.Object item)
Constructs a new instance.
|
Modifier and Type | Method and 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() |
public ItemDescriptor(int version, java.lang.Object item)
version
- the version numberitem
- an object or nullpublic int getVersion()
public java.lang.Object getItem()
public static DataStoreTypes.ItemDescriptor deletedItem(int version)
version
- the version numberpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object