public class DefaultProxyStore extends java.lang.Object implements ProxyStore
| Constructor and Description |
|---|
DefaultProxyStore()
Construct an empty DefaultProxyStore.
|
DefaultProxyStore(java.lang.String payload)
Construct a DefaultProxyStore using the a value returned from
encode(). |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
encode()
Return a JSON object literal with the contents of the store.
|
Splittable |
get(java.lang.String key)
Called by
ProxySerializer to retrieve a value previously provided
to ProxyStore.put(String, Splittable). |
int |
nextId()
Returns a non-negative sequence number.
|
void |
put(java.lang.String key,
Splittable value)
Called by
ProxySerializer to store a value. |
public DefaultProxyStore()
public DefaultProxyStore(java.lang.String payload)
throws java.lang.IllegalArgumentException
encode().payload - a String previously returned from encode()java.lang.IllegalArgumentException - if the payload cannot be parsedpublic java.lang.String encode()
public Splittable get(java.lang.String key)
ProxyStoreProxySerializer to retrieve a value previously provided
to ProxyStore.put(String, Splittable).get in interface ProxyStorekey - the keynull if key is unknownpublic int nextId()
ProxyStorenextId in interface ProxyStorepublic void put(java.lang.String key,
Splittable value)
ProxyStoreProxySerializer to store a value.put in interface ProxyStorekey - a key value that will be passed to ProxyStore.get(String)value - the data to storeSplittable.getPayload()