Class DefaultProxyStore
java.lang.Object
com.google.web.bindery.requestfactory.shared.DefaultProxyStore
- All Implemented Interfaces:
ProxyStore
An in-memory ProxyStore store that can encode its state as a JSON object
literal.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty DefaultProxyStore.DefaultProxyStore(String payload) Construct a DefaultProxyStore using the a value returned fromencode(). -
Method Summary
Modifier and TypeMethodDescriptionencode()Return a JSON object literal with the contents of the store.Called byProxySerializerto retrieve a value previously provided toProxyStore.put(String, Splittable).intnextId()Returns a non-negative sequence number.voidput(String key, Splittable value) Called byProxySerializerto store a value.
-
Constructor Details
-
DefaultProxyStore
public DefaultProxyStore()Construct an empty DefaultProxyStore. -
DefaultProxyStore
Construct a DefaultProxyStore using the a value returned fromencode().- Parameters:
payload- a String previously returned fromencode()- Throws:
IllegalArgumentException- if the payload cannot be parsed
-
-
Method Details
-
encode
Return a JSON object literal with the contents of the store. -
get
Description copied from interface:ProxyStoreCalled byProxySerializerto retrieve a value previously provided toProxyStore.put(String, Splittable).- Specified by:
getin interfaceProxyStore- Parameters:
key- the key- Returns:
- the associated value or
nullifkeyis unknown
-
nextId
public 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 interfaceProxyStore
-