# Class Ext.state.Provider

Package: | Ext.state
Defined In: | Provider.js
Class: | Provider
Subclasses: | CookieProvider
Extends: | Object

Abstract base class for state provider implementations. This class provides methods for encoding and decoding typed variables including dates and defines the Provider interface.

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| clear( `String name` ) : void Clears a value from the state Clears a value from the state Parameters: `name` : String The key name Returns: void | Provider
| decodeValue( `String value` ) : Mixed Decodes a string previously encoded with encodeValue. Decodes a string previously encoded with encodeValue. Parameters: `value` : String The value to decode Returns: `Mixed` The decoded value | Provider
| encodeValue( `Mixed value` ) : String Encodes a value including type information. Decode with decodeValue. Encodes a value including type information. Decode with decodeValue. Parameters: `value` : Mixed The value to encode Returns: `String` The encoded value | Provider
| get( `String name`, `Mixed defaultValue` ) : Mixed Returns the current value for a key Returns the current value for a key Parameters: `name` : String The key name `defaultValue` : Mixed A default value to return if the key's value is not found Returns: `Mixed` The state data | Provider
| set( `String name`, `Mixed value` ) : void Sets the value for a key Sets the value for a key Parameters: `name` : String The key name `value` : Mixed The value to set Returns: void | Provider

## Public Events

Event | Defined By
--- | ---
| statechange : ( `Provider this`, `String key`, `String value` ) Fires when a state change occurs. Fires when a state change occurs. Listeners will be called with the following arguments: `this` : Provider This state provider `key` : String The state key which was changed `value` : String The encoded value for the state | Provider