storage.RichStorage Extends goog.storage.Storage
Provides a storage for data with attached metadata.

Inheritance

Constructor

goog.storage.RichStorage(mechanism)

Parameters

mechanism : !goog.storage.mechanism.Mechanism
The underlying storage mechanism.

Instance Methods

Public Protected Private
get()
No description.
code »
getWrapper(key) ⇒ (!Object | undefined)
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.
Arguments:
key : string
The key to get.
Returns: (!Object | undefined)  The wrapper, or undefined if not found.
code »
set()
No description.
code »
get(key) *
Gets an item from the data storage.
Arguments:
key : string
The key to get.
Returns: *  Deserialized value or undefined if not found.
code »
remove(key)
Removes an item from the data storage.
Arguments:
key : string
The key to remove.
code »
set(keyvalue)
Sets an item in the data storage.
Arguments:
key : string
The key to set.
value : *
The value to serialize to a string and save.
code »

Instance Properties

constructor :
No description.
Code »
The mechanism used to persist key-value pairs.
Code »

Static Properties

goog.storage.RichStorage.DATA_KEY :
Metadata key under which the actual data is stored.
Code »
goog.storage.RichStorage.superClass_ :
No description.
Code »

Package storage

Package Reference