The goog.storage.RichStorage.Wrapper Class

goog.storage.RichStorage.Wrapper(value)

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

value {*}
The value to wrap.

.unwrap(wrapper)

Unwraps a value, any metadata is discarded (not returned). You might want to use goog.storage.RichStorage.Wrapper.unwrapIfPossible to handle cases where the wrapper is missing.

wrapper {!Object}
The wrapper.
returns {*}
The wrapped value.

.unwrapIfPossible(wrapper)

Convenience method for unwrapping a value. Returns undefined if the wrapper is missing.

wrapper {(!Object|undefined)}
The wrapper.
returns {*}
The wrapped value or undefined.

.wrapIfNecessary(value)

Convenience method for wrapping a value so metadata can be associated with it. No-op if the value is already wrapped or is undefined.

value {*}
The value to wrap.
returns {(!goog.storage.RichStorage.Wrapper|undefined)}
The wrapper.