The goog.storage.RichStorage Class

goog.storage.RichStorage
> goog.storage.Storage

goog.storage.RichStorage(mechanism)

Provides a storage for data with attached metadata.

mechanism {!goog.storage.mechanism.Mechanism}
The underlying storage mechanism.

The goog.storage.RichStorage.Wrapper Class

Wraps a value so metadata can be associated with it. You probably want to use goog.storage.RichStorage.Wrapper.wrapIfNecessary to avoid multiple embeddings. … more

.get(key)

Get an item from the data storage.

key {string}
The key to get.
returns {*}
Deserialized value or undefined if not found.

.getWrapper(key)

Get an item wrapper (the item and its metadata) from the storage. WARNING: This returns an Object, which once used to be goog.storage.RichStorage.Wrapper. This is due to the fact that deserialized objects lose type information and it is hard to do proper typecasting in JavaScript. Be sure you know what you are doing when using the returned value.

key {string}
The key to get.
returns {(!Object|undefined)}
The wrapper, or undefined if not found.

.remove(key)

Inherited from goog.storage.Storage .

Remove an item from the data storage.

key {string}
The key to remove.

.set(key, value)

Set an item in the data storage.

key {string}
The key to set.
value {*}
The value to serialize to a string and save.