write<P> method
Null safety
- String restorationId,
- P value
Stores the provided value
of type P
under the provided restorationId
in the bucket.
Any value that has previously been stored under that ID is overwritten
with the new value. The provided value
must be serializable with the
StandardMessageCodec.
Null values will be stored in the bucket as-is. To remove a value, use remove.
See also:
Implementation
void write<P>(String restorationId, P value) {
assert(_debugAssertNotDisposed());
assert(restorationId != null);
assert(debugIsSerializableForRestoration(value));
if (_rawValues[restorationId] != value || !_rawValues.containsKey(restorationId)) {
_rawValues[restorationId] = value;
_markNeedsSerialization();
}
}