Class DataStoreTypes.SerializedItemDescriptor

  • Enclosing class:
    DataStoreTypes

    public static final class DataStoreTypes.SerializedItemDescriptor
    extends java.lang.Object
    A versioned item (or placeholder) storable in a PersistentDataStore.

    This is equivalent to DataStoreTypes.ItemDescriptor, but is used for persistent data stores. The SDK will convert each data item to and from its serialized string form; the persistent data store deals only with the serialized form.

    • Constructor Summary

      Constructors 
      Constructor Description
      SerializedItemDescriptor​(int version, boolean deleted, java.lang.String serializedItem)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getSerializedItem()
      Returns the data item's serialized representation.
      int getVersion()
      Returns the version number of this data, provided by the SDK.
      int hashCode()  
      boolean isDeleted()
      Returns true if this is a placeholder (tombstone) for a deleted item.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SerializedItemDescriptor

        public SerializedItemDescriptor​(int version,
                                        boolean deleted,
                                        java.lang.String serializedItem)
        Constructs a new instance.
        Parameters:
        version - the version number
        deleted - true if this is a deleted item placeholder
        serializedItem - the serialized data (will not be null)
    • Method Detail

      • getVersion

        public int getVersion()
        Returns the version number of this data, provided by the SDK.
        Returns:
        the version number
      • isDeleted

        public boolean isDeleted()
        Returns true if this is a placeholder (tombstone) for a deleted item. If so, getSerializedItem() will still contain a string representing the deleted item, but the persistent store implementation has the option of not storing it if it can represent the placeholder in a more efficient way.
        Returns:
        true if this is a deleted item placeholder
      • getSerializedItem

        public java.lang.String getSerializedItem()
        Returns the data item's serialized representation. This will never be null; for a deleted item placeholder, it will contain a special value that can be stored if necessary (see isDeleted()).
        Returns:
        the serialized data or null
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object