src/main/java/com/seanchenxi/gwt/storage/client/StorageExt.java
public <T> void put(StorageKey<T> key, T value) throws SerializationException, StorageQuotaExceededException {
    if(value == null){
      throw new NullPointerException();
    }
    try {
      String data = StorageUtils.serialize(key.getClazz(), value);
      // Update store and cache
      String oldData = storage.getItem(key.name());
      storage.setItem(key.name(), data);
      T oldValue = cache.put(key, value);
      fireEvent(StorageChangeEvent.ChangeType.PUT, key, value, oldValue, data, oldData);
    } catch (JavaScriptException e) {
      String msg = e.getMessage();
      if (msg != null && msg.contains("QUOTA") && msg.contains("DOM")) {
        throw new StorageQuotaExceededException(key, e);
      }
      throw e;
    }
  }
public <T> void put(StorageKey<T> key, T value) throws SerializationException, StorageQuotaExceededException {
    if(value == null){
      throw new NullPointerException();
    }
    try {
      String data = StorageUtils.serialize(key.getClazz(), value);
      // Update store and cache
      String oldData = storage.getItem(key.name());
      storage.setItem(key.name(), data);
      T oldValue = cache.put(key, value);
      fireEvent(StorageChangeEvent.ChangeType.PUT, key, value, oldValue, data, oldData);
    } catch (JavaScriptException e) {
      String msg = e.getMessage();
      if (msg != null && msg.contains("QUOTA") && msg.contains("DOM")) {
        throw new StorageQuotaExceededException(key, e);
      }
      throw e;
    }
  }
Store the specified value with the specified key in this storage.

<p>
Note: <code>null</code> value is not allowed. <br/>
If the storage previously contained a mapping for the key, the old
value is replaced.<br/>
{@link StorageKeyFactory} is preferred to get a {@link StorageKey} instance for primitive types.
</p>

@param key key with which the specified value is to be associated
@param value value to be associated with the specified key
@throws SerializationException
@throws StorageQuotaExceededException