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)
ProxyStore
ProxySerializer
to retrieve a value previously provided
to ProxyStore.put(String, Splittable)
.get
in interface ProxyStore
key
- the keynull
if key
is unknownpublic int nextId()
ProxyStore
nextId
in interface ProxyStore
public void put(java.lang.String key, Splittable value)
ProxyStore
ProxySerializer
to store a value.put
in interface ProxyStore
key
- a key value that will be passed to ProxyStore.get(String)
value
- the data to storeSplittable.getPayload()