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 .