Class DefaultProxyStore
- java.lang.Object
- 
- com.google.web.bindery.requestfactory.shared.DefaultProxyStore
 
- 
- All Implemented Interfaces:
- ProxyStore
 
 public class DefaultProxyStore extends java.lang.Object implements ProxyStore An in-memory ProxyStore store that can encode its state as a JSON object literal.
- 
- 
Constructor SummaryConstructors Constructor Description DefaultProxyStore()Construct an empty DefaultProxyStore.DefaultProxyStore(java.lang.String payload)Construct a DefaultProxyStore using the a value returned fromencode().
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringencode()Return a JSON object literal with the contents of the store.Splittableget(java.lang.String key)Called byProxySerializerto retrieve a value previously provided toProxyStore.put(String, Splittable).intnextId()Returns a non-negative sequence number.voidput(java.lang.String key, Splittable value)Called byProxySerializerto store a value.
 
- 
- 
- 
Constructor Detail- 
DefaultProxyStorepublic DefaultProxyStore() Construct an empty DefaultProxyStore.
 - 
DefaultProxyStorepublic DefaultProxyStore(java.lang.String payload) throws java.lang.IllegalArgumentExceptionConstruct a DefaultProxyStore using the a value returned fromencode().- Parameters:
- payload- a String previously returned from- encode()
- Throws:
- java.lang.IllegalArgumentException- if the payload cannot be parsed
 
 
- 
 - 
Method Detail- 
encodepublic java.lang.String encode() Return a JSON object literal with the contents of the store.
 - 
getpublic Splittable get(java.lang.String key) Description copied from interface:ProxyStoreCalled byProxySerializerto retrieve a value previously provided toProxyStore.put(String, Splittable).- Specified by:
- getin interface- ProxyStore
- Parameters:
- key- the key
- Returns:
- the associated value or nullifkeyis unknown
 
 - 
nextIdpublic int nextId() Description copied from interface:ProxyStoreReturns a non-negative sequence number. The actual sequence of values returned by this method is unimportant, as long as the numbers in the sequence are unique.- Specified by:
- nextIdin interface- ProxyStore
 
 - 
putpublic void put(java.lang.String key, Splittable value)Description copied from interface:ProxyStoreCalled byProxySerializerto store a value.- Specified by:
- putin interface- ProxyStore
- Parameters:
- key- a key value that will be passed to- ProxyStore.get(String)
- value- the data to store
- See Also:
- Splittable.getPayload()
 
 
- 
 
-