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
ConstructorDescriptionConstruct 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 byProxySerializer
to retrieve a value previously provided toProxyStore.put(String, Splittable)
.int
nextId()
Returns a non-negative sequence number.void
put
(String key, Splittable value) Called byProxySerializer
to 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:ProxyStore
Called byProxySerializer
to retrieve a value previously provided toProxyStore.put(String, Splittable)
.- Specified by:
get
in interfaceProxyStore
- Parameters:
key
- the key- Returns:
- the associated value or
null
ifkey
is unknown
-
nextId
public int nextId()Description copied from interface:ProxyStore
Returns 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:
nextId
in interfaceProxyStore
-